在我开始编程之前,我从网上拉了一个脚本,看看是否一切正常。我是一个菜鸟,无法弄清楚发生了什么。我讽刺的是,我安装了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
有什么想法吗?
答案 0 :(得分:1)
固定!请参阅:http://www.crummy.com/software/BeautifulSoup/bs4/doc/#problems-after-installation
对于可能遇到此问题的其他人,请从C:\Python27\Lib\site-packageseasy_install.pth
中删除BS4条目,然后删除BS4文件夹及相关文件。
然后运行:
来自CLI的 easy_install beautifulsoup4
并从Aptana Preferences&gt;中删除以前的auto-config Python解释器。 PyDev的。然后重新添加并应用。