2010-05-14 79 views
2

我正在試圖按照this guide來製作一個簡單的Hello World腳本到一個.exe文件中。爲什麼不是pyinstaller使我成爲一個.exe文件?

我的Windows Vista與AMD 64位處理器
我已經安裝了Python 2.6.5(視窗AMD64版)
我已經設置了PATH(如果這是正確的字),以便在命令行Python的識別
我已經安裝了UPX(似乎只有Windows的32位版本),並按照指示將upx.exe的副本粘貼到Python26文件夾中。
我已經安裝了Pywin(Windows AMD 64 Python 2.6版本)
我已經運行了Pyinstaller的Configure.py。它提供了一些錯誤消息,但似乎完成。我不知道這是什麼導致了問題,所以下面是它說當我運行它:

C:\Python26\Pyinstaller\branches\py26win>Configure.py
I: read old config from C:\Python26\Pyinstaller\branches\py26win\config.dat
I: computing EXE_dependencies
I: Finding TCL/TK...
I: Analyzing C:\Python26\DLLs_tkinter.pyd
W: Cannot get binary dependencies for file:
W: C:\Python26\DLLs_tkinter.pyd
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth) File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1] IndexError: list index out of range

I: Analyzing C:\Python26\DLLs_ctypes.pyd
W: Cannot get binary dependencies for file:
W: C:\Python26\DLLs_ctypes.pyd
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Python26\DLLs\select.pyd
W: Cannot get binary dependencies for file:
W: C:\Python26\DLLs\select.pyd
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Python26\DLLs\unicodedata.pyd
W: Cannot get binary dependencies for file:
W: C:\Python26\DLLs\unicodedata.pyd
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Python26\DLLs\bz2.pyd
W: Cannot get binary dependencies for file:
W: C:\Python26\DLLs\bz2.pyd
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Python26\python.exe
I: Dependent assemblies of C:\Python26\python.exe:
I: amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
I: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_ none...
I: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a 1e18e3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
I: Searching for file msvcr90.dll
I: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21 022.8_none_750b37ff97f4f68b\msvcr90.dll
I: Searching for file msvcp90.dll
I: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21 022.8_none_750b37ff97f4f68b\msvcp90.dll
I: Searching for file msvcm90.dll
I: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21 022.8_none_750b37ff97f4f68b\msvcm90.dll
I: Adding Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
I: Adding Microsoft.VC90.CRT\msvcr90.dll
I: Adding Microsoft.VC90.CRT\msvcp90.dll
I: Adding Microsoft.VC90.CRT\msvcm90.dll
W: Cannot get binary dependencies for file:
W: C:\Python26\python.exe
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e 3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
I: Analyzing C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.210 22.8_none_750b37ff97f4f68b\msvcr90.dll
W: Cannot get binary dependencies for file:
W: C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_ 750b37ff97f4f68b\msvcr90.dll
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.210 22.8_none_750b37ff97f4f68b\msvcp90.dll
W: Cannot get binary dependencies for file:
W: C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_ 750b37ff97f4f68b\msvcp90.dll
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

I: Analyzing C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.210 22.8_none_750b37ff97f4f68b\msvcm90.dll
W: Cannot get binary dependencies for file:
W: C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_ 750b37ff97f4f68b\msvcm90.dll
W: Traceback (most recent call last):
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 608, in get Imports
return _getImports_pe(pth)
File "C:\Python26\Pyinstaller\branches\py26win\bindepend.py", line 275, in _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: list index out of range

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...
I: done generating C:\Python26\Pyinstaller\branches\py26win\config.dat

我的Python腳本(名爲Hello.py)是一樣的例子:

#!/usr/bin/env python 
for i in xrange(10000): 
print "Hello, World!" 

這是我的BAT文件,在同一目錄:

set PIP=C:\Python26\Pyinstaller\branches\py26win\
python %PIP%Makespec.py --onefile --console --upx --tk Hello.py
python %PIP%Build.py Hello.spec

當我在運行命令提示符Hello.bat幾個文件是由,其中沒有一個是.exe文件,以及以下顯示爲:

C:\My Files>set PIP=C:\Python26\Pyinstaller\branches\py26win\

C:\My Files>python C:\Python26\Pyinstaller\branches\py26win\Makespec.py --onefil e --console --upx --tk Hello.py wrote C:\My Files\Hello.spec now run Build.py to build the executable

C:\My Files>python C:\Python26\Pyinstaller\branches\py26win\Build.py Hello.spec

I: Dependent assemblies of C:\Python26\python.exe: I: amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none Traceback (most recent call last): File "C:\Python26\Pyinstaller\branches\py26win\Build.py", line 1359, in main(args[0], configfilename=opts.configfile)
File "C:\Python26\Pyinstaller\branches\py26win\Build.py", line 1337, in main build(specfile)
File "C:\Python26\Pyinstaller\branches\py26win\Build.py", line 1297, in build execfile(spec)
File "Hello.spec", line 3, in
pathex=['C:\My Files'])
File "C:\Python26\Pyinstaller\branches\py26win\Build.py", line 292, in __init_ _
raise ValueError, "script '%s' not found" % script
ValueError: script 'C:\Python26\Pyinstaller\branches\py26win\support\useTK.py' n ot found

我有限的知識,在命令提示符下,所以,請帶我的寶寶步驟,如果我需要做的事情還有。

回答

6

在Windows下,pyinstaller不支持64位Python。但是,在64位環境下使用32位Python通常沒有缺點,所以最簡單的選擇是安裝和使用它。它還具有額外的好處,即由pyinstaller生成的可執行文件可以在32位和64位Windows下運行。

+5

對於幾年後發現這個問題的人來說,PyInstaller不久前修復了這個問題。參見[bug#25](http://www.pyinstaller.org/ticket/25)。 – David 2014-03-11 16:16:22

相關問題