ImportError: No module named html.entities

2019-07-30 10:11发布

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条回答
甜甜的少女心
2楼-- · 2019-07-30 10:54

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.

查看更多
登录 后发表回答