tags:

views:

323

answers:

1

I am creating a medium level application in Python. Everything works well now, and I am trying to make this a windows executable with py2exe. The executable is created fine, but when I try to run it, it fails with the following error.

  File "zipextimporter.pyo", line 82, in load_module
  File "ffhandler.pyo", line 33, in ?
  File "zipextimporter.pyo", line 82, in load_module
  File "pyAA\__init__.pyo", line 1, in ?
  File "zipextimporter.pyo", line 82, in load_module
  File "pyAA\AA.pyo", line 8, in ?
  File "zipextimporter.pyo", line 82, in load_module
  File "pyAA\pyAAc.pyo", line 5, in ?
  File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading pyAA\_pyAAc.pyd

I am using pyAA in this application. I searched internet, but was unable to get any solution. I copied msvcp71.dll to windows/system32, but still issue is there.

I had solved it earlier (around 7 months back), but my hard drive crashed and when I try to recreate it, I cannot seem to solve it now. :-(

I would be much obliged if someone could help me out here.

EDIT: When I use py2exe without bundle files option, it is working perfectly. But when I use bundle file option, it is failing.

I tried without zipfile option, wherein it creates a library.zip alongwith the executable. Again it failed. I did unzip of library.zip using 7-zip, and found that _pyAAc.pyd is there in pyAA folder inside the zip file. So, it looks like some issue with memoryloadlibrary function.

When I tried to unzip using windows unzip function, it failed. I had to use 7-zip to unzip it. Is it a possible clue?

A: 

You're missing some DLL's in your build...

First search your hard drive for the file _pyAAC.pyd. Make sure it is included (shipped) in your build.

Then use 'dependency walker' on the .pyd file (in your py2exe compiled version!) to see what it is that is still missing (other DLL's which are causing the MemoryLoadLibrary message for the .pyd file). Make sure these dependencies are also shipped, ...

ChristopheD
Thank you ChristopheD. I checked it, but found that it is indeed shipped. I have made some modifications in my question, please see the same.
Koran
I've seen this before in the past (some dll's don't like to be shipped with the bundle_files option set. Don't really know a way around it. A way could be to build with bundle_files off. Or you could have a look at alternatives: http://stackoverflow.com/questions/1689086/are-there-any-alternatives-to-py2exe (e.g. pyinstaller)
ChristopheD