PyInstaller生成的exe文件无法关闭

3
我有问题,所有由pyInstaller创建的exe文件都出现了问题。在控制台中运行的Python 2.7编写的简单hello world示例中也可以重现此问题。问题是脚本运行(似乎正常运行),但在执行后,“父” shell(我从中运行exe的cmd)会死亡,除了重新启动电脑外,没有任何东西可以关闭它(cmd或total commander都不行)。
因此,父线程仅挂起运行我的exe。我想知道是否已经损坏了pyInstaller或pywin32的安装方式,使用了错误的版本等等?此外,一旦我用脚本中的错误制作了exe,exe就会运行并以典型的Python调试打印退出(但这次父脚本没有挂起)。
编辑: 我已经重新安装了Python,easy-installer,pywin32,pyinstaller,仍然存在同样的问题。这次我从以下url下载了所有x86版本的内容(是链接,但需要10个声望才能发布)。

Pythonez-setup链接在这里Pywin32PyInstaller链接在这里

这个脚本只是一个简单的:

print "Hello World"

构建exe时,pyInstaller的输出:
E:\Projects\Workspace\fileCrawler>pyinstaller --onefile hw.py
36 INFO: wrote E:\Projects\Workspace\fileCrawler\hw.spec
49 INFO: Testing for ability to set icons, version resources...
62 INFO: ... resource update available
63 INFO: UPX is not available.
82 INFO: Processing hook hook-os
181 INFO: Processing hook hook-time
184 INFO: Processing hook hook-cPickle
247 INFO: Processing hook hook-_sre
354 INFO: Processing hook hook-cStringIO
434 INFO: Processing hook hook-encodings
446 INFO: Processing hook hook-codecs
805 INFO: Extending PYTHONPATH with E:\Projects\Workspace\fileCrawler
806 INFO: checking Analysis
1194 INFO: building because C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\_pyi_bootstrap.py changed
1196 INFO: running Analysis out00-Analysis.toc
1198 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
2523 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
2523 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest
2526 INFO: Searching for file msvcr90.dll
2526 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll
2526 INFO: Searching for file msvcp90.dll
2526 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll
2528 INFO: Searching for file msvcm90.dll
2528 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll
2594 INFO: Analyzing C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\_pyi_bootstrap.py
2605 INFO: Processing hook hook-os
2617 INFO: Processing hook hook-site
2630 INFO: Processing hook hook-encodings
2724 INFO: Processing hook hook-time
2727 INFO: Processing hook hook-cPickle
2792 INFO: Processing hook hook-_sre
2903 INFO: Processing hook hook-cStringIO
2993 INFO: Processing hook hook-codecs
3384 INFO: Processing hook hook-pydoc
3496 INFO: Processing hook hook-email
3549 INFO: Processing hook hook-httplib
3588 INFO: Processing hook hook-email.message
3647 INFO: Analyzing C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_importers.py
3684 INFO: Analyzing C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_archive.py
3720 INFO: Analyzing C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_carchive.py
3755 INFO: Analyzing C:\Python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_os_path.py
3759 INFO: Analyzing hw.py
3760 INFO: Hidden import 'codecs' has been found otherwise
3762 INFO: Hidden import 'encodings' has been found otherwise
3762 INFO: Looking for run-time hooks
3887 INFO: Using Python library C:\Windows\system32\python27.dll
4236 INFO: Warnings written to E:\Projects\Workspace\fileCrawler\build\hw\warnhw.txt
4240 INFO: checking PYZ
4255 INFO: building because toc changed
4255 INFO: building PYZ (ZlibArchive) out00-PYZ.toc
4838 INFO: checking PKG
4855 INFO: building because E:\Projects\Workspace\fileCrawler\build\hw\out00-PYZ.pyz changed
4855 INFO: building PKG (CArchive) out00-PKG.pkg
5743 INFO: checking EXE
5744 INFO: rebuilding out00-EXE.toc because pkg is more recent
5744 INFO: building EXE from out00-EXE.toc
5759 INFO: Appending archive to EXE E:\Projects\Workspace\fileCrawler\dist\hw.exe

我的系统是一个i5(64位)的Windows 7。


我刚在我的系统上测试了一下,它运行得很好...似乎没有任何问题退出了。 - Joran Beasley
2个回答

1
我不知道为什么会错过它,但这只是我的Avast杀毒软件干扰了。其中一个防护模块导致我的所有Python可执行文件在完成后"停滞"其调用父窗口。

0

今天我重新安装了Python、easy-installer、pywin32和pyinstaller,所有的版本都是相同的(2.7 x86),但仍然出现了相同的错误。 - Oskar Andersson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接