gpt4 book ai didi

python - easy_install 没有安装 Mechanize?

转载 作者:行者123 更新时间:2023-12-04 16:18:36 27 4
gpt4 key购买 nike

我正在从旧的 Win2K 机器迁移到新的、功能更强大的 Vista 64 位 PC。大部分迁移进行得相当顺利 - 但我确实发现我需要重新安装所有与 Python 相关的工具。

我已经下载了 mechanize-0.1.11.tar.gz 文件并运行 easy_install 来安装它。这产生了 C:\Python25\Lib\site-packages\mechanize-0.1.11-py2.5.egg。

然后我运行了一个 python 脚本来测试它,它在解释器下运行良好。但是,当我运行 py2exe 来编译脚本时,我收到一条消息,提示找不到 mechanize。

然后我将鸡蛋移动到一个新文件夹,使用 easy_install 安装它 - 并得到它确实安装的所有迹象。

但是,在尝试使用 py2exe 时,我仍然收到相同的消息 - 该 Mechanize 不存在!

我搜索了整个磁盘的“Mechanize ”,结果只得到了 2 个蛋文件。安装应该生成哪些文件 - 我应该在哪里放置它们?

显然,我在这里遗漏了一些东西……有什么建议吗?

另外,也许相关,我正在运行的 python 是 32 位 2.5.4 版本......这是我以前拥有的并且希望在安装 64 位版本之前让一切正常工作 - 另外,我没有看到一些似乎支持 64 位版本的工具(easy_install 和 py2exe)。这是否是问题的一部分,我是否需要安装并运行 64 位版本 - 对于那些在运行我的脚本时运行 32 位 PC 的人来说,这会是一个问题吗?

最佳答案

有一个note on the py2exe site如果源是 Egg 格式,则它不起作用:

py2exe does not currently (as of 0.6.5) work out of the box if some of your program's dependencies are in .egg form.

If your program does not itself use setuptools facilities (eg, pkg_resources), then all you need to do is make sure the dependencies are installed on your system in unzipped form, rather than in a zipped .egg.

One way to achieve this is to use the --always-unzip option to easy_install.



你运行的是哪个版本? pypi.python.org 上列出的最新版本是 0.6.9 版,但没有迹象表明我可以找到此版本中是否修复了鸡蛋的问题。

关于python - easy_install 没有安装 Mechanize?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1151256/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com