【问题标题】:Python - Mechanize - import failure (python 3.3 on MacOS 10.7)Python - 机械化 - 导入失败(MacOS 10.7 上的 python 3.3)
【发布时间】:2014-03-14 16:26:00
【问题描述】:

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

任何建议表示赞赏。

【问题讨论】:

    标签: macos python-3.x mechanize mechanize-python


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2012-05-24
      • 2011-08-29
      • 1970-01-01
      • 1970-01-01
      • 2011-10-13
      • 1970-01-01
      • 2010-09-21
      • 1970-01-01
      • 2018-04-21
      相关资源
      最近更新 更多