cx_Freeze ImportError, how do I debug this

Jeffrey Britton jeffb0098 at gmail.com
Tue Jan 10 23:38:29 EST 2012


On Jan 10, 8:21 pm, Jeffrey Britton <jeffb0... at gmail.com> wrote:
> 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.



More information about the Python-list mailing list