简体   繁体   English

py2exe或pyinstaller无法包含jaraco.util

[英]py2exe or pyinstaller fail to include jaraco.util

I have a small python script for irc which needs jaraco.util to function. 我有一个用于irc的小python脚本,需要jaraco.util才能起作用。 Requirement is to release it as binary on windows so I've tried with py2exe and pyinstaller . 要求是在Windows上以二进制形式发布它,因此我尝试使用py2exepyinstaller

I am using WinPython-64bit-2.7.6.4 我正在使用WinPython-64bit-2.7.6.4

I have some experience with py2exe from previous projects, I tried the 'includes' option as well but without any success. 我在以前的项目中有使用py2exe经验,我也尝试了'includes'选项,但没有成功。 The error is pretty much standard: 该错误几乎是标准的:

ImportError: No module named jaraco

Or jaraco.util etc. if I try to include it via setup.py for the py2exe build. jaraco.util等。如果我尝试通过setup.py将其包含在py2exe构建中。

      'includes': [
                   'jaraco.util',
                   'irc',
                   'ConfigParser',
          ],

Normally it should auto-detect the dependencies but if I leave it without the include it will build the exe but fail to execute with a similar error: 通常,它应该自动检测依赖项,但是如果我不包含include的话,它将生成exe,但无法执行,并出现类似的错误:

Traceback (most recent call last)
  File "irc\client.pyc", line 67, in <module>
ImportError: No module named jaraco.util.itertools

In winpython site-packages I have: winpython站点软件包中,我有:

jaraco
jaraco.timing-1.0-py2.7-nspkg.pth
jaraco.timing-1.0-py2.7.egg-info
jaraco.util-10.6-py2.7-nspkg.pth
jaraco.util-10.6-py2.7.egg-info

I also tried to reinstall jaraco.util and to copy it manually after the build but it will still not work. 我还尝试重新安装jaraco.util并在构建后手动将其复制,但仍然无法正常工作。

I've searched on-line for a solution for at least a couple of hours but to no avail. 我已经在网上搜索了至少两个小时的解决方案,但无济于事。 so I'm trying here maybe you guys have run into similar issues (or maybe I'm doing something wrong...) 所以我在这里尝试也许你们遇到了类似的问题(或者我做错了...)

Thank you 谢谢

I think the problem is that jaraco was installed via easy_install jaraco.util , thus creating python eggs, which aren't supported by py2exe , as detailed by its FAQ . 我认为问题在于jaraco是通过easy_install jaraco.util安装的,从而创建了python鸡蛋, py2exe不支持python鸡蛋,如其FAQ所述

Try specifying the flag --always-unzip as an option to easy_install . 尝试将标志--always-unzip指定为easy_install的选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM