我正在尝试按照本指南将简单的 Hello World 脚本制作成 .exe 文件。
我有带有 AMD 64 位处理器的 Windows Vista
我已经安装了 Python 2.6.5(Windows AMD64 版本)
我已经设置了 PATH(如果这是正确的话),以便命令行能够识别
我已经安装了 UPX(似乎只有为 Windows 的 32 位版本)并按照说明将 upx.exe 的副本粘贴到 Python26 文件夹中。
我已经安装了 Pywin(Windows AMD 64 Python 2.6 版本)
我已经运行了 Pyinstaller 的 Configure.py。它提供了一些错误消息,但似乎已完成。我不知道这是否是导致问题的原因,所以以下是我运行它时的内容:
C:\Python26\Pyinstaller\branches\py26win>Configure.py
I: 从 C:\Python26\Pyinstaller\branches\py26win\config.dat 读取旧配置
I: 计算 EXE_dependencies
I: 查找 TCL/TK...
I: 分析C:\Python26\DLLs_tkinter.pyd
W: 无法获取文件的二进制依赖项:
W: C:\Python26\DLLs_tkinter.pyd
W: Traceback(最近一次调用最后):
文件“C:\Python26\Pyinstaller\branches\py26win\ bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth) 文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 275 行,在 _getImports_pe
importva 中,importsz = datadirs[1] IndexError:列表索引超出范围I: 正在分析 C:\Python26\DLLs_ctypes.pyd
W: 无法获取文件的二进制依赖项:
W: C:\Python26\DLLs_ctypes.pyd
W: Traceback(最近一次调用最后):
文件“C:\Python26\Pyinstaller\branches \py26win\bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth)
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 275 行,在 _ge tImports_pe
importva,importsz = datadirs[1 ]
IndexError: 列表索引超出范围I: Analyzing C:\Python26\DLLs\select.pyd
W: 无法获取文件的二进制依赖项:
W: C:\Python26\DLLs\select.pyd
W: Traceback (最近一次调用最后):
File "C:\Python26 \Pyinstaller\branches\py26win\bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth)
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 275 行,在 _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: 列表索引超出范围I: 正在分析 C:\Python26\DLLs\unicodedata.pyd
W: 无法获取文件的二进制依赖项:
W: C:\Python26\DLLs\unicodedata.pyd
W: Traceback (最近一次调用最后一次):
文件 "C:\Python26 \Pyinstaller\branches\py26win\bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth)
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 275 行,在 _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: 列表索引超出范围I: 分析 C:\Python26\DLLs\bz2.pyd
W: 无法获取文件的二进制依赖项:
W: C:\Python26\DLLs\bz2.pyd
W: Traceback (最近一次调用最后):
文件 "C:\Python26 \Pyinstaller\branches\py26win\bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth)
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 275 行,在 _ge tImports_pe
importva, importsz = datadirs[1]
IndexError: 列表索引超出范围I: 分析 C:\Python26\python.exe
I: C:\Python26\python.exe 的依赖程序集:
I: amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none
I: 搜索程序集 amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022。 none...
I: 找到清单 C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a 1e18e3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
I: 搜索文件 msvcr90.dll
I: 找到文件 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: 搜索文件 msvcm90.dll
I: 找到文件 C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21 022.8_none_750b37ff97f4f68b\msvcm90.dll
I: 添加 Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
I:添加 Microsoft.VC90.CRT\msvcr90.dll
I:添加 Microsoft.VC90.CRT\msvcp90.dll
I:添加 Microsoft.VC90.CRT\msvcm90.dll
W:无法获取文件的二进制依赖项:
W:C:\Python26\ python.exe
W:回溯(最近一次调用):
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth)
文件“C:\Python26\Pyinstaller \branches\py26win\bindepend.py",第 275 行,在 _getImports_pe 中
importva,importsz = datadirs[1]
IndexError:列表索引超出范围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获取文件的二进制依赖项:
W: C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_ 750b37ff97f4f68b\msvcr90.dll
W: Traceback(最近一次调用):
文件“C:\Python26\Pyinstaller\branches\ py26win\bindepend.py”,第 608 行,在 get Imports 中
返回 _getImports_pe(pth)
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 275 行,在 _ge tImports_pe
importva,importsz = datadirs[1]
IndexError:列表索引超出范围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:回溯(最近一次调用最后):
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 608 行,在获取导入
返回 _getImports_pe(pth)
文件“C:\Python26 \Pyinstaller\branches\py26win\bindepend.py",第 275 行,在 _getImports_pe
importva 中,importsz = datadirs[1]
IndexError: list index out of rangeI: 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:回溯(最近一次调用最后):
文件“C:\Python26\Pyinstaller\branches\py26win\bindepend.py”,第 608 行,在获取导入
返回 _getImports_pe(pth)
文件“C:\Python26 \Pyinstaller\branches\py26win\bindepend.py",第 275 行,在 _getImports_pe
importva,importsz = datadirs[1]
IndexError: list index out of rangeI: 找不到 TCL/TK
I: 测试 Zlib...
I: ... Zlib 可用
I: 测试设置图标、版本资源的能力...
I: ... 资源更新可用
I: 测试 Unicode支持...
I: ... Unicode 可用
I: 测试 UPX...
I: ...UPX 可用
I: 计算 PYZ 依赖项...
I: 完成生成 C:\Python26\Pyinstaller\branches\py26win\config .dat
我的 Python 脚本(名为 Hello.py)与示例相同:
#!/usr/bin/env python
for i in xrange(10000):
print "Hello, World!"
这是我的 BAT 文件,在同一目录中:
设置 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:\我的文件>设置 PIP=C:\Python26\Pyinstaller\branches\py26win\
C:\My Files>python C:\Python26\Pyinstaller\branches\py26win\Makespec.py --onefile e --console --upx --tk Hello.py 写了 C:\My Files\Hello.spec 现在运行 Build .py 构建可执行文件
C:\我的文件>python C:\Python26\Pyinstaller\branches\py26win\Build.py Hello.spec
I:C:\Python26\python.exe 的依赖程序集: I: amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none Traceback(最近一次调用最后):文件“C:\Python26\Pyinstaller\branches\py26win\Build.py” ,第 1359 行,在 main(args[0], configfilename=opts.configfile)
文件“C:\Python26\Pyinstaller\branches\py26win\Build.py”中,第 1337 行,在主构建(specfile)
文件“C:\ Python26\Pyinstaller\branches\py26win\Build.py”,第 1297 行,在构建 execfile(spec)
文件“Hello.spec”,第 3 行,在
pathex=['C:\My Files'])
文件“C:\ Python26\Pyinstaller\branches\py26win\Build.py",第 292 行,在 __init__ 中
引发 ValueError,"找不到脚本 '%s'" % 脚本
ValueError: 找不到脚本'C:\Python26\Pyinstaller\branches\py26win\support\useTK.py'
我对命令提示符的了解有限,所以如果我需要在那里做一些事情,请和我一起采取一些步骤。