我在尝试将 wxpython 应用程序编译成 exe 文件时遇到了很多麻烦。py2exe 不断给我错误,并且不会将我的代码编译为 exe。以下是我运行一个简单的 setup.py 脚本时发生的情况。我在 Windows 64 位和 python 2.7 上并使用 py2exe 64 位。(捆绑在 64 位 py2exe 中不起作用。不确定这是否会造成问题)我相信我安装了所有正确的 DLL,因为我安装了 Microsoft Visual Studio。任何帮助,将不胜感激。
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'P4API' (C:\Python27\lib\site-packages\P4AP
I.pyd -> P4API.pyd)
creating python loader for extension 'wx._misc_' (C:\Python27\lib\site-packages\
wx-2.8-msw-unicode\wx\_misc_.pyd -> wx._misc_.pyd)
creating python loader for extension 'select' (C:\Python27\DLLs\select.pyd -> se
lect.pyd)
creating python loader for extension 'unicodedata' (C:\Python27\DLLs\unicodedata
.pyd -> unicodedata.pyd)
creating python loader for extension 'wx._windows_' (C:\Python27\lib\site-packag
es\wx-2.8-msw-unicode\wx\_windows_.pyd -> wx._windows_.pyd)
creating python loader for extension 'wx._core_' (C:\Python27\lib\site-packages\
wx-2.8-msw-unicode\wx\_core_.pyd -> wx._core_.pyd)
creating python loader for extension 'wx._gdi_' (C:\Python27\lib\site-packages\w
x-2.8-msw-unicode\wx\_gdi_.pyd -> wx._gdi_.pyd)
creating python loader for extension 'wx._controls_' (C:\Python27\lib\site-packa
ges\wx-2.8-msw-unicode\wx\_controls_.pyd -> wx._controls_.pyd)
creating python loader for extension 'bz2' (C:\Python27\DLLs\bz2.pyd -> bz2.pyd)
*** finding dlls needed ***
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(windows=['PerforceApp.py'])
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 243, in run
self._run()
File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 305, in _run
dlls = self.find_dlls(extensions)
File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 389, in find_dl
ls
self.dll_excludes)
File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1064, in find_d
ependend_dlls
bin_depends(loadpath, images + [sys.executable], excludes_use)
File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1441, in bin_de
pends
if isSystemDLL(dll):
File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1498, in isSyst
emDLL
raise Exception, "Seems not to be an exe-file"
Exception: Seems not to be an exe-file