问题
I am new to python. I am using python 2.7.5. I want to write a web crawler. For that I have installed BeautifulSoup 4.3.2. I have installed it using this command(I haven't used pip)
python setup.py install
I am using eclipse 4.2 with pydev installed. When I try to import this library in my script
from bs4 import BeautifulSoup
I am getting this error
ImportError: No module named html.entities
Please explain me what should I do to rectify it.
回答1:
Is there any reason why are you not using pip install
, are you on windows, mac, linux ? With that information we could help you faster. Appart from that. This is often a problem when you have more than 1 python installation on your system. Read the followingBeautifulSoup problems after installation.
Also, consider installing using sudo pip install
if unix, that handles dependecies very well. You could also try on a shell from bs4 import BeautifulSoup
and see if you get the same error you are getting on pydev.
来源:https://stackoverflow.com/questions/20544694/importerror-no-module-named-html-entities