使用Python3.3在MacOS 10.7上成功安装了机械化。
但是当我尝试它时,我会失败。
>>> import mechanize
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/mechanize-0.2.5-py3.3.egg/mechanize/__init__.py", line 119, in <module>
ImportError: No module named '_version'
>>>
这是环境:
>>> print (sys.version)
3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 01:12:57)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
>>> print(*sys.path, sep='\n')
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/setuptools-3.1-py3.3.egg
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/mechanize-0.2.5-py3.3.egg
/Library/Frameworks/Python.framework/Versions/3.3/lib/python33.zip
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/plat-darwin
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages
>>>
任何建议表示赞赏。
答案 0 :(得分:0)
我在Windows 7上遇到同样的问题。他们在这里说http://wwwsearch.sourceforge.net/mechanize/documentation.html#compatibility “mechanize适用于Python 2.4,Python 2.5,Python 2.6和Python 2.7。”似乎不支持3.3版本。