python - 导入错误: No module named mechanize

标签 python python-2.7 import

我正在使用 easy_install,并且输入:

easy_install mechanize

它返回的最后一行是:

Finished processing dependencies for mechanize

现在当我尝试:

import mechanize

我收到此错误:

ImportError: No module named mechanize

知道出了什么问题吗?谢谢

最佳答案

你检查过 python shell 中的 sys.path 吗?

>>> import sys
>>> sys.path
# Returns a list of directories & .egg files

为了让 python 找到 mechanize,它需要位于 sys.path 上列出的位置之一。如果你知道 mechanize 的安装位置,那么你可以直接检查它是否在 sys.path 上(我不知道如何自动找出它的安装位置)。

关于python - 导入错误: No module named mechanize,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18795395/

相关文章:

python - 在 Django 的 View/Template 中引用多个 Model

python - 需要找到有效的方法来找到强数

Python - 一次从文件中读取 1000 行

python - 交换多维 Python 列表的轴

Android Studio 不会按字典顺序重新排列导入

python - Python 中的 "Type comparisons"

Python [Errno 17] 文件存在问题

python - 延迟加载/配置要继承的类

java - 将现有项目导入 eclipse 给我带来了很多错误

用于预导入模块的 Python 线程