Question

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?

Was it helpful?

Solution

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, ...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top