0

在开始编程之前,我从网上提取了一个脚本以查看是否一切正常。我是菜鸟,无法弄清楚发生了什么。具有讽刺意味的是,我安装了 easy_install 以使事情顺利进行。

我正在使用 Windows 7 64 位。

pydev debugger: starting
Traceback (most recent call last):
  File "C:\Users\Me\AppData\Local\Aptana Studio 3\plugins\org.python.pydev_2.7.0.2013032300\pysrc\pydevd.py", line 1397, in <module>
    debugger.run(setup['file'], None, None)
  File "C:\Users\Me\AppData\Local\Aptana Studio 3\plugins\org.python.pydev_2.7.0.2013032300\pysrc\pydevd.py", line 1090, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "C:\Users\Me\Documents\Aptana Studio 3 Workspace\PythonScripts\PythonScripts\setupscript.py", line 1, in <module>
    from bs4 import BeautifulSoup
  File "build\bdist.win-amd64\egg\bs4\__init__.py", line 29, in <module>
  File "build\bdist.win-amd64\egg\bs4\builder\__init__.py", line 4, in <module>
  File "build\bdist.win-amd64\egg\bs4\element.py", line 5, in <module>
  File "build\bdist.win-amd64\egg\bs4\dammit.py", line 11, in <module>
ImportError: No module named html.entities

进口是:

from bs4 import BeautifulSoup
from mechanize import Browser

有任何想法吗?

4

1 回答 1

1

固定的!请参阅:http ://www.crummy.com/software/BeautifulSoup/bs4/doc/#problems-after-installation

对于可能遇到此问题的任何其他人,请从 中删除 BS4 条目C:\Python27\Lib\site-packageseasy_install.pth,然后删除 BS4 文件夹和相关文件。

然后运行:

easy_install beautifulsoup4从 CLI 并从 Aptana Preferences > PyDev 中删除以前的自动配置 Python 解释器。然后重新添加并应用。

于 2013-06-08T15:52:00.847 回答