ImportError:没有名为html.entities的模块

时间:2013-12-12 13:20:47

标签: python-2.7 beautifulsoup web-crawler html-entities importerror

我是python的新手。我使用的是python 2.7.5。我想写一个网络爬虫。为此,我安装了BeautifulSoup 4.3.2。我已使用此命令安装它(我没有使用过pip)

python setup.py install

我正在使用安装了pydev的eclipse 4.2。当我尝试在我的脚本中导入此库时

from bs4 import BeautifulSoup

我收到此错误

ImportError: No module named html.entities

请解释我应该怎么做才能纠正它。

1 个答案:

答案 0 :(得分:1)

你有没有理由不使用pip install,你在windows,mac,linux上吗?有了这些信息,我们可以更快地帮助您。那个公寓。当您的系统上安装了多个python时,这通常是一个问题。阅读以下BeautifulSoup problems after installation

另外,考虑使用sudo pip install安装ifix,它可以很好地处理依赖。您也可以尝试使用shell from bs4 import BeautifulSoup,看看是否在pydev上遇到了同样的错误。