views:

119

answers:

4

Hi,

Is anyone able to get pyAA working with py2exe? pyAA can be downloaded here.

I have trying to do this for the last 2 days and I am unable to reach a solution till now. The example files are like given below:

hello.py

import pyAA
print "Hello, World"

setup.py

from distutils.core import setup
import py2exe

setup(console=['hello.py'],
      options = {"py2exe": {"bundle_files": 1}})

Now, if we run:

 python setup.py py2exe

the executable is created. But running it gives the following error:

Traceback (most recent call last):
File "hello.py", line 1, in ?
  File "zipextimporter.pyc", line 82, in load_module
  File "pyAA\__init__.pyc", line 1, in ?
  File "zipextimporter.pyc", line 82, in load_module
  File "pyAA\AA.pyc", line 8, in ?
  File "zipextimporter.pyc", line 82, in load_module
  File "pyAA\pyAAc.pyc", line 5, in ?
  File "zipextimporter.pyc", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading pyAA\_pyAAc.pyd

I tried using dependency walker but I was unable to make too much sense of the same. I tried to add/delete some DLLs but to no avail.

p.s -> Please note that without bundle_files, it is working perfectly. But one of the requirements of the projects mean that bundle_file is required.

+2  A: 

This king of thing seems to be a common problem with py2exe. Maybe try using another installer such as PyInstaller.

ars
A: 

When I install pyAA and run depends on _pyAAc.pyd, it tells me I'm missing IESHIMS.DLL, though that might be because I'm on Windows 7.

Ned Batchelder
One of the DLLs I had mentioned in the OP was this IESHIMS.DLL. I tried to add that in the same folder etc but to no avail. Is there any solution to it?
Koran
A: 

_pyAAc.pyd is a DLL, I think those have to be loaded directly from the file system (not from memory buffers or archives).

If a one-file-solution is needed you could do your own bundling of the working unbundled py2exe result that unpacks itself to TEMP and runs from there. I suspect some self extracting archive maker could do this trick for you without the need for any coding on your part.

Toni Ruža
I will try this out. For now, I was able to get it working with pyInstaller though.
Koran
A: 

Having fought with Py2Exe a few times myself, bundling DLLs with dependencies usually causes headaches. If my memory serves me correctly, try adding sys.exec_prefix to PATH environment variable. This should allow the program to find the IESHIMS.DLL

os.environ['PATH'] = os.sep.join([sys.exec_prefix, os.environ['PATH']])
Shane Holloway
I tried this, but to no avail. I do doubt that it is due to IESHIMS.DLL, since I have tried almost 2/3 days on this.
Koran