Python - 导入新模块时出现问题 - libgmail
我从sourceforge下载了Python模块 libgmail 并提取了档案。存档中有 setup.py,所以我在命令提示符下转到该目录,并
setup.py install
收到以下错误消息
I:\libgmail-0.1.11>setup.py install
Traceback (most recent call last):
File "I:\libgmail-0.1.11\setup.py", line 7, in ?
import libgmail
File "I:\libgmail-0.1.11\libgmail.py", line 36, in ?
import mechanize as ClientCookie
ImportError: No module named mechanize
这可能很简单,但我是 python 新手。所以请指导该怎么做。
请注意,我使用的是 python 2.4 并使用 Windows-XP。
谢谢
微内核
I downloaded Python module libgmail from sourceforge and extracted all the files in the archive. The archive had setup.py, so I went to that directory in command prompt and did
setup.py install
I am getting the following error message
I:\libgmail-0.1.11>setup.py install
Traceback (most recent call last):
File "I:\libgmail-0.1.11\setup.py", line 7, in ?
import libgmail
File "I:\libgmail-0.1.11\libgmail.py", line 36, in ?
import mechanize as ClientCookie
ImportError: No module named mechanize
This may be trivial, but I am new to python. So plz guide what to do.
please note, I am using python 2.4 and using Windows-XP.
Thank you
MicroKernel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为这个库取决于这个:
http://wwwsearch.sourceforge.net/mechanize/
首先尝试安装它。
I think this lib depends on this one:
http://wwwsearch.sourceforge.net/mechanize/
Try installing it first.
您需要下载并安装名为 mechanize 的模块。根据您的操作系统(即 Linux),您的包管理器可能有一些相关的东西,否则您将需要谷歌它,并按照它的安装说明进行操作。
You need to download and install the module called mechanize. Depending on your operating system (ie. Linux), your package manager probably has something for this, otherwise you will need to google it, and follow it's installation instructions.
easy_install mechanize
如果这不起作用,您需要修复 PATH 环境变量以包含 python 安装目录\scripts 的路径。 easy_install 将来会为您节省大量时间。
PS:Python 2.4 已经有 6 岁了,你真的应该至少考虑一下 2.6。
easy_install mechanize
If this doesn't work, you need to fix your PATH environment variable to include path to your python installation directory\scripts. easy_install will save you a lot of time in future.
P.S.: Python 2.4 is 6 years old, you should really consider at least 2.6.