views:

92

answers:

2

I am attempting to run a py2exe'd program (package.py) that includes pysvn. It is failing to run with the following error:

Traceback (most recent call last):  
   File "package.py", line 27, in <module>  
   File "zipextimporter.pyc", line 82, in load_module  
   File "pysvn\__init__.pyc", line 99, in <module>  
   File "zipextimporter.pyc", line 98, in load_module  
ImportError: MemoryLoadLibrary failed loading pysvn\_pysvn_2_6.pyd  

The script runs fine for others in the office, the difference being I'm on Windows 7 x64 with them on WinXP x86. I do have _pysvn_2_6.pyd in my pysvn directory.

Py2exe's "Problems to be Fixed" page has a similar error message with WxPython where it cannot find a needed system module, but I am not using WxPython and I have the dll they refer to anyway.

The py2exe page for "Working with Various Packages and Modules" doesn't refer to pysvn, and I can't find anyone else with similar problems.

I've checked the output of py2exe as outlined by this answer, but my computer seems to have all the binary files required in the correct locations.

EDIT: I just tried to run other py2exe created programs on this same machine and they failed as well. It seems that the problem is with my machine (ie x64) rather than the specific program I was converting; I get a similar error with another program:

Traceback (most recent call last):
  File "rundemo.py", line 13, in <module>
    import win32api as w32
  File "zipextimporter.pyc", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading win32api.pyd

EDIT2: I tried the py2exe programs generated from my 64 bit compy on a 32 bit machine, and they failed with the same error. I think I'm generating 32 bit exe's (py2exe docs say 64-bit support is experimental, and I haven't explicitly turned it on), but I'm not sure how to check to be sure.

A: 

Install PyWin32.

mcandre
I could be wrong, but I don't think this is true. Py2exe is being run for package.py on my computer as part of our automated build script. Another part of the script is then trying to run the package.exe that was created.
Topher
Try running py2exe on an x64 computer and running the result on your x64 test machine.
mcandre
That's what I am doing now- running py2exe on my own x64 Win7, and then running the resulting program on the same machine.
Topher
I already have PyWin32 installed- it's part of our default installation. I just reinstalled it and tried again but I still cannot run my py2exe generated programs.
Topher
A: 

The py2exe project seems dead, so we rewrote our exes in C++. We can still build for Win7 x64 on our machines, but we couldn't get exe's wrote on Win7 to run on anything older.

Topher