本文介绍了输出的py2exe exe仅在签名后才会运行:ImportError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有一个用python 2.6制作的程序,它可以像普通python一样运行,并且在通过py2exe v0.6.9制成exe时也可以运行.我使用signtool对其进行了签名,没有做任何其他更改,但是它停止了工作.

So, I've got a program I made in python 2.6, it ran fine as normal python, and ran fine when made into an exe via py2exe v0.6.9. I used signtool to sign it, having changed nothing else, and it stops working.

运行签名的exe时,我从脚本的第1行收到"ImportError:没有名为os的模块".我进行了一些挖掘,发现了这一点: http://osdir.com/ml/python.py2exe/2008-04/msg00031.html ,这似乎是对我的问题的非常详尽的描述.我将从py2exe网站链接的修补程序手动应用到我的build_exe.py文件,尽管我正在运行py2exe 0.6.9而不是0.6.6,所以我尝试考虑到这一点.还是没有爱.

When I run the signed exe, I receive an "ImportError: No module named os" from line 1 of my script. I did some digging and found this: http://osdir.com/ml/python.py2exe/2008-04/msg00031.html, which seems to be a very close description of my problem. I manually applied the patch linked to from the py2exe website to my build_exe.py file, though I was running py2exe 0.6.9 instead of 0.6.6, so I tried to take that into account. Still no love.

根据链接,这似乎是py2exe问题.我也不知道任何帮助将非常感激.当然,我会回答您对此有的其他疑问.感谢您的帮助!

According to the link, this seems to be a py2exe issue. I don't know though. Any help would be much appreciated. And of course, I'll answer any other questions I can that you have about this. Thanks for the help!

推荐答案

如果是py2exe问题,则可以使用更新的 PyInstaller 创建可执行文件的镜头.它正在积极开发中,与py2exe不同,py2exe显然自2008-11-16以来就没有进行过更新.

If it's a py2exe issue, maybe give the newer PyInstaller a shot to build your executable. It's in active development, unlike py2exe which apparently hasn't been updated since 2008-11-16.

这篇关于输出的py2exe exe仅在签名后才会运行:ImportError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 23:47