views:

98

answers:

1

I have created a simple program which uses pywin32. I want to deploy it as an executable, so I py2exe'd it. I also didn't want a huge amount of files, so I set bundle_files to 1 (meaning bundle everything together). However, when I attempt running it, I get:

Traceback (most recent call last):
  File "pshelper.py", line 4, in <module>
  File "zipextimporter.pyc", line 82, in load_module
  File "win32.pyc", line 8, in <module>
  File "zipextimporter.pyc", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading win32ui.pyd

In my setup script, I tried doing packages=["win32ui"] and includes=["win32ui"] as options, but that didn't help. How can I get py2exe to include win32ui.pyd?

I don't have this problem if I don't ask it to bundle the files, so I can do that, for now, but I'd like to know how to get it to work properly.

A: 

Are you sure that the problem is that win32ui.pyd is not included? The stack trace isn't exactly the same as noted in the wiki, but check this out: http://www.py2exe.org/index.cgi/Py2exeAndWin32ui.

Jeremy Brown
i think that's the case because I get the DLL load error when i don't try to bundle the files. this just seems to be an issue w/ bundling.
Claudiu
py2exe won't bundle external DLLs into the archive or executable. Try slurping the MFC files into the directory containing the exe and see if it runs.As a side note - if you don't have zipfile = None, then you can unzip the archive to see whether or not your suspicions of win32ui.pyd not being bundled are warranted.
Jeremy Brown