ImportError: No module named html.entities

戏子无情 提交于 2019-12-24 12:46:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!