0

使用 Python3.3 在 MacOS 10.7 上成功安装 mechanize。

但是当我尝试它时,我会失败。

>>> 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
>>>

任何建议表示赞赏。

4

1 回答 1

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版本。

于 2014-03-19T06:37:08.170 回答