部署Python程序时遇到问题(与py2exe打包在一起) [英] Problem deploying Python program (packaged with py2exe)

查看:115
本文介绍了部署Python程序时遇到问题(与py2exe打包在一起)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题:我的程序使用py2exe,并且在我的计算机上可以使用.我将它与Inno Setup打包在一起(仍然可以在我的计算机上使用),但是当我将其发送到另一台计算机时,尝试运行该应用程序时出现以下错误:"CreateProcess失败;代码14001."该应用程序将无法运行. (注意:我在程序中使用wxPython和多处理模块.) 我在Google上搜索了一下,发现用户应该安装一些MS可重新分发的东西,但是我不想让我的用户的生活变得复杂.有解决办法吗?

I have a problem: I used py2exe for my program, and it worked on my computer. I packaged it with Inno Setup (still worked on my computer), but when I sent it to a different computer, I got the following error when trying to run the application: "CreateProcess failed; code 14001." The app won't run. (Note: I am using wxPython and the multiprocessing module in my program.) I googled for it a bit and found that the the user should install some MS redistributable something, but I don't want to make life complicated for my users. Is there a solution?

版本:

Python 2.6.2c1, py2exe 0.6.9, Windows XP Pro

Python 2.6.2c1, py2exe 0.6.9, Windows XP Pro

推荐答案

您需要包括msvcr90.dll,Microsoft.VC90.CRT.manifest和python.exe.manifest(重命名为[yourappname] .exe.manifest)在您的安装目录中.如果您使用"Just for me"选项安装了Python,这些文件将位于系统上的Python26目录中.

You need to include msvcr90.dll, Microsoft.VC90.CRT.manifest, and python.exe.manifest (renamed to [yourappname].exe.manifest) in your install directory. These files will be in the Python26 directory on your system if you installed Python with the "Just for me" option.

关于此操作的说明可以在此处找到.

别忘了调用 multiprocessing.freeze_support(),否则在开始新流程时会遇到问题.

Don't forget to call multiprocessing.freeze_support() in your main function also, or you will have problems when you start a new process.

尽管其他人已经讨论过在安装包中包括MSVC运行时,但是当您只希望分发包含所有文件的单个.zip文件时,上述解决方案有效.当您不希望出现其他复杂情况时,它可以避免创建单独的安装程序包.

While others have discussed including the MSVC runtime in your install package, the above solution works when you only want to distribute a single .zip file containing all your files. It avoids having to create a separate install package when you don't want that additional complication.

这篇关于部署Python程序时遇到问题(与py2exe打包在一起)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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