Home Why doesn't Python 3 find installed packages (e.g. BeautifulSoup4)?
Reply: 0

Why doesn't Python 3 find installed packages (e.g. BeautifulSoup4)?

user869
1#
user869 Published in May 25, 2018, 11:12 am

Using Ubuntu 16.04 with Python 3.5 I get import errors for some packages, e.g. 'BeautifulSoup4' or 'requests'. Both libraries are installed from the Ubuntu repositories:

$ dpkg --get-selections | grep -E "python3-req|python3-bs"
python3-bs4                         install
python3-requests                    install

Yet I get "ImportError: no module named 'bs4'/'requests'".

$ python3 -c "import bs4"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'bs4'

Only when I (additionally!) install those libraries via pip3 it works. The documentation of BeautifulSoup says to install it as "python3-bs4" via apt. Why does it only work with the pip3 method? What's the purpose of the python3-bs4/python3-requests packages?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300854 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO