Reputation: 1671
I try to import library: from bs4 import BeautifulSoup
.
When I run script I get error:
Traceback (most recent call last):
File "index.py", line 9, in <module>
from bs4 import BeautifulSoup
ImportError: No module named bs4
root@srvr [/home/public_html/grabber/similar]#
When I try install:
pip install beautifulsoup4
I get the following error:
Requirement already satisfied: beautifulsoup4 in /usr/lib/python2.6/site-packages/beautifulsoup4-4.5.1-py2.6.egg
Script is:
import sys
sys.path.append('/usr/lib/python2.6/site-packages')
from bs4 import BeautifulSoup
Upvotes: 2
Views: 23894
Reputation: 121
If you use Pycharm, go to preferences - project interpreter - install bs4. If you try to install BeautifulSoup, it will still show that no module named bs4.
Upvotes: 0
Reputation: 671
If you try this on Mac OS X do the following:
python setup.py install
Upvotes: 4
Reputation: 82939
You installed BeautifulSoup for Python 2.6, but according to your tag, you are using Python 3.x. To install explicitly for Python 3, use pip3
instead of pip
, i.e.
pip3 install beautifulsoup4
Upvotes: 10