Benjamin Pollack Benjamin Pollack - 5 months ago 22
Python Question

MemoryLoadError when trying to run py2exe application

I am attempting to bundle up a Python application using py2exe 0.6.9 and Python 2.6.4 on Windows. While the executable runs just fine on the system I used to build it, it fails when I attempt to run it on another system:

C:\Documents and Settings\Administrator\Desktop\dist>.\backend.exe install
Traceback (most recent call last):
File "boot_service.py", line 6, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "win32serviceutil.pyo", line 9, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading win32api.pyd


I have a strong hunch that I'm missing a library, but I'm unsure which—especially since the dependency checker isn't flagging anything as missing on the target system. How should I proceed?

Answer

same question as http://stackoverflow.com/questions/1979486/py2exe-win32api-pyc-importerror-dll-load-failed.

look at setup.py, just excludes these dlls which are included in the system.

 'dll_excludes': [ "mswsock.dll", "powrprof.dll" ]

it will help you!

Comments