2010-03-19 40 views
1

我想通過在Windows Vista上使用PyInstaller編譯一個非常簡單的wxPython腳本到可執行文件。從PyInstaller與wxPython崩潰產生的.exe

Python腳本不過是wxPython中的Hello World。我試圖在添加程序需要的任何功能之前,將它作爲Windows可執行文件運行。但我已經卡住了。我已經跳過了一些循環MSVCR90.DLL,MSVCP90.DLL和MSVCPM90.DLL,我最終從我的Visual Studio安裝複製(C:\ Program Files \ Microsoft Visual Studio 9.0 \ VC \ 90 \ REDIST \ 86 \ Microsoft.VC90.CRT)。根據對PyInstaller說明

至於,我跑:

Command: 
Configure.py 

Output: 
I: computing EXE_dependencies 
I: Finding TCL/TK... 
I: could not find TCL/TK 
I: testing for Zlib... 
I: ... Zlib available 
I: Testing for ability to set icons, version resources... 
I: ... resource update available 
I: Testing for Unicode support... 
I: ... Unicode available 
I: testing for UPX... 
I: ...UPX available 
I: computing PYZ dependencies... 

到目前爲止,一切都很好。我繼續。

Command: 
Makespec.py -F guitest.py 

Output: 
wrote C:\Code\PromoUSB\guitest.spec 
now run Build.py to build the executable 

然後是最後的命令。

Command: 
Build.py guitest.spec 

Output: 
checking Analysis 
building Analysis because out0.toc non existent 
running Analysis out0.toc 
Analyzing: C:\Python26\pyinstaller-1.3\support\_mountzlib.py 
Analyzing: C:\Python26\pyinstaller-1.3\support\useUnicode.py 
Analyzing: guitest.py 
Warnings written to C:\Code\PromoUSB\warnguitest.txt 
checking PYZ 
rebuilding out1.toc because out1.pyz is missing 
building PYZ out1.toc 
checking PKG 
rebuilding out3.toc because out3.pkg is missing 
building PKG out3.pkg 
checking ELFEXE 
rebuilding out2.toc because guitest.exe missing 
building ELFEXE out2.toc 

我得到所產生的「guitest.exe」文件,但在執行時,它「只是崩潰」 ......並沒有調試信息。它只是那些標準的Windows Vista崩潰之一。

腳本本身,guitest.py本身運行得很好。它只是作爲一個可執行文件崩潰,我完全失去了。我甚至不知道該找什麼,因爲我試過的東西都沒有返回任何相關的結果。

另一個文件是由於編譯過程而產生的,名爲'warnguitest.txt'。這裏是它的內容。


W: no module named posix (conditional import by os) 
W: no module named optik.__all__ (top-level import by optparse) 
W: no module named readline (delayed, conditional import by cmd) 
W: no module named readline (delayed import by pdb) 
W: no module named pwd (delayed, conditional import by posixpath) 
W: no module named org (top-level import by pickle) 
W: no module named posix (delayed, conditional import by iu) 
W: no module named fcntl (conditional import by subprocess) 
W: no module named org (top-level import by copy) 
W: no module named _emx_link (conditional import by os) 
W: no module named optik.__version__ (top-level import by optparse) 
W: no module named fcntl (top-level import by tempfile) 
W: __all__ is built strangely at line 0 - collections (C:\Python26\lib\collections.pyc) 
W: delayed exec statement detected at line 0 - collections (C:\Python26\lib\collections.pyc) 
W: delayed conditional __import__ hack detected at line 0 - doctest (C:\Python26\lib\doctest.pyc) 
W: delayed exec statement detected at line 0 - doctest (C:\Python26\lib\doctest.pyc) 
W: delayed conditional __import__ hack detected at line 0 - doctest (C:\Python26\lib\doctest.pyc) 
W: delayed __import__ hack detected at line 0 - encodings (C:\Python26\lib\encodings\__init__.pyc) 
W: __all__ is built strangely at line 0 - optparse (C:\Python26\pyinstaller-1.3\optparse.pyc) 
W: __all__ is built strangely at line 0 - dis (C:\Python26\lib\dis.pyc) 
W: delayed eval hack detected at line 0 - os (C:\Python26\lib\os.pyc) 
W: __all__ is built strangely at line 0 - __future__ (C:\Python26\lib\__future__.pyc) 
W: delayed conditional __import__ hack detected at line 0 - unittest (C:\Python26\lib\unittest.pyc) 
W: delayed conditional __import__ hack detected at line 0 - unittest (C:\Python26\lib\unittest.pyc) 
W: __all__ is built strangely at line 0 - tokenize (C:\Python26\lib\tokenize.pyc) 
W: __all__ is built strangely at line 0 - wx (C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.pyc) 
W: __all__ is built strangely at line 0 - wx (C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.pyc) 
W: delayed exec statement detected at line 0 - bdb (C:\Python26\lib\bdb.pyc) 
W: delayed eval hack detected at line 0 - bdb (C:\Python26\lib\bdb.pyc) 
W: delayed eval hack detected at line 0 - bdb (C:\Python26\lib\bdb.pyc) 
W: delayed __import__ hack detected at line 0 - pickle (C:\Python26\lib\pickle.pyc) 
W: delayed __import__ hack detected at line 0 - pickle (C:\Python26\lib\pickle.pyc) 
W: delayed conditional exec statement detected at line 0 - iu (C:\Python26\pyinstaller-1.3\iu.pyc) 
W: delayed conditional exec statement detected at line 0 - iu (C:\Python26\pyinstaller-1.3\iu.pyc) 
W: delayed eval hack detected at line 0 - gettext (C:\Python26\lib\gettext.pyc) 
W: delayed __import__ hack detected at line 0 - optik.option_parser (C:\Python26\pyinstaller-1.3\optik\option_parser.pyc) 
W: delayed conditional eval hack detected at line 0 - warnings (C:\Python26\lib\warnings.pyc) 
W: delayed conditional __import__ hack detected at line 0 - warnings (C:\Python26\lib\warnings.pyc) 
W: __all__ is built strangely at line 0 - optik (C:\Python26\pyinstaller-1.3\optik\__init__.pyc) 
W: delayed exec statement detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 
W: delayed conditional eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 
W: delayed eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 
W: delayed conditional eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 
W: delayed eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 

我不知道該做什麼。再一次,我的搜索沒有結果。

+0

有些偏離主題,但由於您只是在wxPython中編寫了一個「hello,world」應用程序,我會放棄它並重新開始使用PyQt。文檔更好,整體最終產品看起來也更好。 – 2010-03-20 01:15:11

+0

wxPython是免費的。 – 2010-03-20 15:46:26

回答

0

我在PyInstaller郵件列表中發現了這個問題的解決方案,它非常簡單,只是沒有記錄。

PyInstaller尚不支持Python 2.6。解決方案是從一個頁面中獲取補丁,如果試圖使用Python 2.6進行編譯,那麼現在可以在我嘗試的編譯過程中找到該補丁。

謝謝大家!

編輯:頁面曾經託管在http://svn.pyinstaller.org/branches/py26win但它不再存在。

+1

你應該把鏈接 – thelost 2012-02-26 02:36:21

+0

啊,是的,我應該有。不過,我早已忘記了這件事。感謝提示,下次我會記得。 – Teekin 2012-02-28 13:30:08

+3

仍然有人有這些問題,會喜歡這個鏈接 – 2012-08-03 16:10:05

0

在windows上,我發現Py2exe更穩定,更易於使用,你有沒有試過。