Python:PyQt4 Py2exe [英] Python: PyQt4 Py2exe

查看:46
本文介绍了Python:PyQt4 Py2exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

所以我制作了一个 Python 应用程序,它使用了非常棒的 PyQt 作为它的界面.现在,如果我要为 Py2Exe 指定 --bundle 0 选项,则生成的编译后的可执行文件工作正常!但是有了所有需要的文件,文件夹就会变得杂乱无章.所以我尝试为 --bundle 选项传递 1 和 2.一个将所有内容打包到文件文件中,而另一个将除 Python dll 之外的所有内容打包.然而,这两个选项都会导致可执行文件在执行时退出.没有错误被退回.

So I've made a Python application that uses the ever so great PyQt as it's interface. Now if I was to specify the --bundle 0 option for Py2Exe the resulting compiled executable file works fine! But with all the needed files, the folder gets cluttered up. So I tried passing 1 and 2 for the --bundle option. One packs everything into file file whilst the other packs everything except the Python dll. However both of those options results in the executable file exiting upon execution. No errors are chucked back.

stackoverflow 上的另一个问题说为 py2exe 提供--includes sip"参数,但这并不能解决这个问题.sip 模块已经包含在应用程序的所有构建中,所以我认为它与 sip 没有任何关系.

Another question on stackoverflow said to supply the "--includes sip" parameter for py2exe however that does not solve this issue. The sip module was already being included in all builds of the application so I can't think it has anything to do with sip.

我使用 procmon 来监控文件在执行时的行为.谁能解释一下?http://www.sendspace.com/file/z67dox

I've used procmon to monitor what the file did upon execution. Can anyone make light of this? http://www.sendspace.com/file/z67dox

谢谢再见!

推荐答案

我知道即使在 py2exe 中使用原始的 win32ui 也会导致问题.看起来它们可能是相关的,但我对 PyQt 的架构了解不够.

I know that even using raw win32ui with py2exe can cause problems. Seems like they could be related, but I don't know enough about the architecture of PyQt.

Py2exeAndWin32ui

虽然我意识到即使它确实有帮助,也不会给你一个简洁的解决方案.

Though I realise this wouldn't give you a neat solution even if it did help.

这篇关于Python:PyQt4 Py2exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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