【发布时间】:2014-03-19 04:19:17
【问题描述】:
我已经为 python3 安装了机械化库。 https://github.com/adevore/mechanize/tree/python3
但是,当我导入它时,我得到了这个错误。
Python 3.3.3 (default, Dec 30 2013, 16:15:14)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import mechanize
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Username/.virtualenvs/python3/lib/python3.3/site-packages/mechanize-0.2.6.dev_20140305-py3.3.egg/mechanize/__init__.py", line 122, in <module>
File "/Users/Username/.virtualenvs/python3/lib/python3.3/site-packages/mechanize-0.2.6.dev_20140305-py3.3.egg/mechanize/_mechanize.py", line 15, in <module>
File "/Users/Username/.virtualenvs/python3/lib/python3.3/site-packages/mechanize-0.2.6.dev_20140305-py3.3.egg/mechanize/_html.py", line 16, in <module>
ImportError: cannot import name _sgmllib_copy
但是,我确信 mechanize 安装在同一个 virtualenv 目录中。
$ pip freeze
## FIXME: could not find svn URL in dependency_links for this package:
mechanize==0.2.6.dev-20140305
pyquery==1.2.8
Warning: cannot find svn location for mechanize==0.2.6.dev-20140305
我不习惯在终端操作,所以不知道如何解决这个问题。
谁能帮我解决这个问题?
提前谢谢你!
【问题讨论】:
-
你有没有在 Python 3 上工作过 mechanize?
标签: python python-3.x mechanize-python