简体   繁体   English

pyinstaller exe无法关闭

[英]pyinstaller exe won't close

I have problems with all exe files created by pyInstaller. pyInstaller创建的所有exe文件都有问题。 It's reproduceable in a simple hello world example written in python 2.7 that runs in the console. 它可以在控制台中运行的用Python 2.7编写的简单hello world示例中重现。 The problem is that the script runs (seems to run ok), but after the execution the "parent" shell (the cmd where I ran the exe from) dies and nothing short of a reboot of the pc will close it (cmd or total commander both). 问题是脚本可以运行(似乎可以正常运行),但是执行后,“父”外壳(我从中运行exe的cmd)就死了,短短重启PC便无法关闭它(cmd或total)统帅)。

So the parent thread just hangs running my exe's. 因此,父线程只是在运行我的exe时挂起。 I am wondering if I have botched the install of pyInstaller or pywin32 somehow, used the wrong version etc? 我想知道是否以某种方式破坏了pyInstaller或pywin32的安装,使用了错误的版本等? Also, once I made the exe with an error in the script, the exe ran and exited with the typical python debug print (but the parent script did NOT hang this time). 另外,一旦我使exe脚本出错,该exe便会运行并退出并显示典型的python调试打印信息(但父脚本这次没有挂起)。

Edit: I have since reinstalled python, easy-installer, pywin32, pyinstaller and still have the same problem. 编辑:自从我重新安装了python,easy-installer,pywin32,pyinstaller之后,仍然遇到相同的问题。 I downloaded everything in x86 version this time around from the following url's (was links but need 10 rep to post): 这次我从以下网址下载了x86版本的所有内容(是链接,但需要发布10个代表):

Python , ez-setup link here , Pywin32 , PyInstaller link here Pythonez-setup链接在这里Pywin32PyInstaller链接在这里

The script is just a simple: 该脚本很简单:

print "Hello World"

The pyInstaller output when building the exe: 生成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

My system is a i5 (64 bit) Windows 7. 我的系统是i5(64位)Windows 7。

If you're having problems then try to re-install the program. 如果遇到问题,请尝试重新安装该程序。 Or try to download a more recent version of Python. 或尝试下载更新版本的Python。

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

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

I do not fathom how I could miss it, but its simply my Avast antivirus program interfering. 我不知道我怎么会错过它,而仅仅是我的Avast防病毒程序干扰了。 One of the shields was causing all my python exe's to "stall" its calling parent window upon completion. 盾牌之一是使我所有的python exe在完成时“停止”其调用父窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM