Skip to content Skip to sidebar Skip to footer

How To Install Beautifulsoup Into Python3, When Default Dir Is Python2.7?

I have both Python 2.7 and Python 3.5 installed. When I type pip install beautifulsoup4 it tells me that it is already installed in python2.7/site-package directory. But how do I i

Solution 1:

I think pip3 will satisfy your needs, use the below command on the terminal:

pip3 install beautifulsoup4

See doc

Solution 2:

Run as root:

apt-get install python3-bs4
#or
pip3 install beautifulsoup4

Afterwards import it like this:

import bs4

Solution 3:

If you’re using a recent version of Debian or Ubuntu Linux, you can install Beautiful Soup with the system package manager:

$ apt-get install python-bs4 (for Python 2)
$ apt-get install python3-bs4 (for Python 3)

Afer install import the library

from bs4 importBeautifulSoup

Solution 4:

The package is bs4 and can be installed with following command:

python -m pip install bs4

Solution 5:

I had some mismatch between Python version and Beautifulsoup. I was installing this project Th3Jock3R/LinuxGSM-Arma3-Mod-Update to a linux centos8 dedicated Arma3 server. Python3 and Beautifulsoup4 seem to match.So I updated Python3, removed manually Beautifulsoup files and re-installed it with: sudo yum install python3-beautifulsoup4 (note the number 3). Works. Then pointing directories in Th3Jock3R:s script A3_SERVER_FOLDER = "" and A3_SERVER_DIR = "/home/arma3server{}".format(A3_SERVER_FOLDER) placing and running the script in same folder /home/arma3server with python3 update.py. In this folder is also located new folder called 'modlists' Now the lightness of mod loading blows my mind. -Bob-

Post a Comment for "How To Install Beautifulsoup Into Python3, When Default Dir Is Python2.7?"