pyinstaller exe不会关闭

时间:2014-04-07 20:37:38

标签: python exe pywin32 pyinstaller

我对pyInstaller创建的所有exe文件都有问题。它可以在一个简单的hello world示例中重现,该示例使用在控制台中运行的python 2.7编写。问题是脚本运行(似乎运行正常),但在执行后,“父”shell(我运行exe的cmd)死亡,没有任何简短的重启pc将关闭它(cmd或总数指挥官)。

所以父线程只是挂起运行我的exe。我想知道我是不是以某种方式搞砸了pyInstaller或pywin32的安装,使用了错误的版本等?此外,一旦我在脚本中出现错误的exe,exe运行并退出典型的python调试打印(但是这次父代脚本没有挂起)。

编辑: 我已经重新安装了python,easy-installer,pywin32,pyinstaller,但仍然有同样的问题。我这次从x86版下载了以下url的所有内容(链接但需要10个帖子才能发布):

Python ez-setup链接Pywin32 PyInstaller链接

脚本很简单:

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。

2 个答案:

答案 0 :(得分:0)

如果您遇到问题,请尝试重新安装该程序。或者尝试下载更新版本的Python。

https://pypi.python.org/pypi/pywin32-ctypes/0.0.1

https://pypi.python.org/pypi?%3Aaction=index

答案 1 :(得分:0)

我不知道如何错过它,但它只是我的Avast防病毒程序干扰。其中一个盾牌导致我所有的python exe在完成时“停止”其调用父窗口。