Python py2exe ImportError: MemoryLoadLibrary failed to load glib \ _glib.pyd

I had a problem creating 1 package of files (exe) with py2exe. When I run the program, I get:

Traceback (most recent call last):
File "keys.py", line 3, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "gtk\__init__.pyo", line 30, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "gobject\__init__.pyo", line 26, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "glib\__init__.pyo", line 22, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading glib\_glib.pyd

I have setup.py:

from distutils.core import setup
import py2exe, sys, os, gtk

sys.argv.append('py2exe')

setup(
options = {'py2exe': {
    'includes': "cairo, pango, pangocairo, atk, gobject, gio",
    'bundle_files': 1,
    "excludes": "pywin, pywin.dialogs, pywin.dialogs.list, svn",
    "packages": "email, encodings",
    "dll_excludes": ["mswsock.dll, powrprof.dll, shfolder.dll, credui.dll, msvcp60.dll, secur32.dll"],
    "optimize":2,
    'compressed': True
    }
},
windows=[{'script':'keys.py'}],
zipfile = None,
)

When I do bundle_file = 3, everything works fine, but I cannot get make bundle_file1 or 2 to work without error MemoryLoadLibraryfor glib.

I reinstalled python2.7, installed pygtk all-in-one-bundle. I wiped the pigtails and tried to install PyCairo, PyGObject, Glade and PyGtk from stand alones, but still I get the same Import Error.

setup.py so great that I read so much about other problems with pyd, but not with glib, so I just added all the tips to the setting to make it work.

Is there any way to fix this ImportError? Am I doing something wrong?

+4
1

python - , , RAM. , .

-1

All Articles