When I package a minimal Python 2.7.1/wxPython program (Hello World) with py2exe
with the most basic "configuration" and run it on a pristine Windows 7 x32 virtual machine, save "Microsoft Visual C++ 2008 Redistributable Package (x86)" installed, I get the unhelpful error:
Z:\>z:\wxhello\wxhello.exe
Traceback (most recent call last):
File "wxhello.py", line 1, in <module>
File "wx\__init__.pyc", line 45, in <module>
File "wx\_core.pyc", line 4, in <module>
File "wx\_core_.pyc", line 12, in <module>
File "wx\_core_.pyc", line 10, in __load
ImportError: DLL load failed: The system cannot find the file specified.
All the DLLs listed at the end of running py2exe exist on the target VM save for gdiplus.dll
, some wxPython library that I manually copied into the dist path.
Text and Tkinter
"Hello World's" both work fine.
What's wrong? Can I get some more helpful debugging information?
The same process using cx_Freeze
gives a slightly different error:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
File "wxhello.py", line 1, in <module>
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in <module>
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in <module>
File "ExtensionLoader_wx__core_.py", line 12, in <module>
ImportError: DLL load failed: The system cannot find the file specified.
Update:
The failure of the cx_Freeze
generated program to run was solved by running it off the local drive (on the VM), versus off a network share. I didn't test if that also fixed the py2exe
'binary'.