cx_Freeze ImportError, how do I debug this

J

Jeffrey Britton

I am building a standalone Windows executable using cx_Freeze.
The resulting executable will not run and writes the following error
to the console.

ImportError: could not import gobject (error was: 'No module named
gobject')

The project using the gtk libraries for Cairo and Pango on Windows.
The program runs fine when run with Python.
I have tried copying anything that cx_Freeze may have missed from the
gtk installation under the Python directory.

My question is, is there a method to debug this, that can tell me more
about what is going on?

The executable directory already contains
_gobject.pyd
libgobject-2.0-0.dll
libcairo-gobject-2.dll
and a bunch of other stuff.

I can type
import gobject
in the Python shell and that works.
 
J

Jeffrey Britton

I am building a standalone Windows executable using cx_Freeze.
The resulting executable will not run and writes the following error
to the console.

ImportError: could not import gobject (error was: 'No module named
gobject')

The project using the gtk libraries for Cairo and Pango on Windows.
The program runs fine when run with Python.
I have tried copying anything that cx_Freeze may have missed from the
gtk installation under the Python directory.

My question is, is there a method to debug this, that can tell me more
about what is going on?

The executable directory already contains
_gobject.pyd
libgobject-2.0-0.dll
libcairo-gobject-2.dll
and a bunch of other stuff.

I can type
import gobject
in the Python shell and that works.

I just realized that I can import just Cairo and build and
executable. However, a test script with simply
import Pango
print 'hello'
fails.
This time I tried building with PyInstaller and I get the same error
about not being able to load gobject.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top