如何用py2exe打包Twisted程序? [英] How to package Twisted program with py2exe?

查看:58
本文介绍了如何用py2exe打包Twisted程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 py2exe 打包一个 Twisted 程序,但是一旦我运行我构建的 exe 文件,我就会收到没有名为资源的模块"错误.

I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error.

然后我发现 py2exe 说:

And I found the py2exe said:

以下模块似乎缺失 ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resources', 'pywintypes', 'resource', 'win32api', 'win32con', 'win32event', 'win32file', 'win32pipe', 'win32process', 'win32security']

The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resources', 'pywintypes', 'resource', 'win32api', 'win32con', 'win32event', 'win32file', 'win32pipe', 'win32process', 'win32security']

那么我该如何解决这个问题?

So how do I solve this problem?

谢谢.

推荐答案

我以前见过这个... py2exe,出于某种原因,没有检测到 ZIP 存档中需要这些模块,而是将它们排除在外.

I've seen this before... py2exe, for some reason, is not detecting that these modules are needed inside the ZIP archive and is leaving them out.

您可以在 py2exe 命令行中明确指定要包含的模块:

You can explicitly specify modules to include on the py2exe command line:

python setup.py py2exe -p win32com -i twisted.web.resource

类似的东西.仔细阅读选项和实验.

Something like that. Read up on the options and experiment.

这篇关于如何用py2exe打包Twisted程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆