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 install it into the python3 dir?
To install Beautifulsoup on Windows, Linux, or any operating system, one would need pip package. To check how to install pip on your operating system, check out – PIP Installation – Windows || Linux. Wait and relax, Beautifulsoup would be installed shortly.
To use beautiful soup, you need to install it: $ pip install beautifulsoup4 . Beautiful Soup also relies on a parser, the default is lxml . You may already have it, but you should check (open IDLE and attempt to import lxml). If not, do: $ pip install lxml or $ apt-get install python-lxml .
On Suse Linux 13.2, pip calls python3, but pip2 is available to use the older python version.
pip installs the Python 2 version of the package, and pip3 will install the Python 3 version of the package. it should install all the modules listed on the file.
I think pip3 will satisfy your needs, use the below command on the terminal:
pip3 install beautifulsoup4
See doc
Run as root:
apt-get install python3-bs4 #or pip3 install beautifulsoup4
Afterwards import it like this:
import bs4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With