Python:PyQt4 Py2exe

编程入门 行业动态 更新时间:2024-10-22 10:59:59
本文介绍了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 来监控文件在执行时的行为.谁能解释一下?www.sendspace/file/z67dox

I've used procmon to monitor what the file did upon execution. Can anyone make light of this? www.sendspace/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

本文发布于:2023-07-04 17:20:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1027014.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Python   Py2exe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!