安装了 mechanize 后,我好像无法导入它。
我尝试使用 pip、easy_install 和通过这个仓库的
我尝试使用 pip、easy_install 和通过这个仓库的
python setup.py install
进行安装:https://github.com/abielr/mechanize。但每次进入 Python 交互界面时都无济于事,显示如下:Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mechanize
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mechanize
>>>
我之前运行的安装程序报告说它们已经成功完成了,因此我期望导入会成功。是什么导致了这个错误?
sys.path
以查看你是否在正确的位置查找,使用ls -laR /usr/local/lib/python2.7/dist-packages/mech*
检查权限问题,以及查看imp.find_module("mechanize")
以区分找不到和导入错误的区别吗? - DSMconda
安装它了吗? - Charlie Parker