I am using py2exe, but the concept should be the same.  You are going
to need to include the runtime with your program.  Just make it be a
subdirectory like gtk.  I use the all in one installer to install a
clean runtime only directory http://gladewin32.sf.net/ and copy the
whole directory structure over(you will want to do runtime only
because the devel files add a lot of disk usage)

In your app, detect that it is you have used cx_Freeze (in py2exe you
can check for the existance of sys.frozen).
Then muck with the python environment settings:
os.environ['PATH'] = os.path.join(prog_dir, 'gtk', 'lib') + ';' +
os.environ['PATH']

you might also need to muck with other gtk specific environment variables:
http://developer.gimp.org/api/2.0/gtk/gtk-running.html

Unfortunately I do not have the code with me or I would just copy in
the relevant sections.

-Chris

On Tue, 4 Jan 2005 07:24:35 -0500, Thomas Mills Hinkle
<[EMAIL PROTECTED]> wrote:
> I am working with a collaborator (the ever patient Roland Duhaime) on
> freezing my pygtk app on Windows using cx_Freeze. Using resources
> found here as well as the following useful website
> (http://s1x.homelinux.net/documents/Xpython/xpython), we've made a
> gread deal of progress.
> 
> However, the executable is still not running on a machine that's not
> already setup with gtk. It appears that the missing piece is now
> whatever library handles pixbuf loading. Here's the output from
> running the exe file:
> 
> C:\gourmet\dist>GourmetRecipeManager.exe
> (GourmetRecipeManager.exe): GdkPixbuf-WARNING **: Can not open pixbuf loader 
> mod
> ule file 'C:\gourmet\dist\etc\gtk-2.0\gdk-pixbuf.loaders': No such file or 
> direc
> tory
> Traceback (most recent call last):
>  File 
> "C:\usr\roland\python\cx_freeze-3.0.1\cx_Freeze-3.0.1\initscripts\console
> .py", line 26, in ?
>  File "C:\Python23\Lib\site-packages\gourmet\GourmetRecipeManager.py", line 
> 102
> 5, in ?
>  File "C:\Python23\Lib\site-packages\gourmet\GourmetRecipeManager.py", line 
> 989
> , in startGUI
> gobject.GError: Couldn't recognize the image file format for file 
> 'C:\gourmet\da
> ta\recbox.png'
> C:\gourmet\dist>
> 
> Here are the contents of the directory cx_Freeze created (showing the
> libraries that have been included alongside the executable):
> atk.pyd
> gobject.pyd
> GourmetRecipeManager.exe
> gtk.glade.pyd
> gtk._gtk.pyd
> Mk4py.dll
> mmap.pyd
> pango.pyd
> pyexpat.pyd
> python23.dll
> tcl84.dll
> tk84.dll
> zlib.pyd
> _imaging.pyd
> _imagingtk.pyd
> _socket.pyd
> _sre.pyd
> _ssl.pyd
> _tkinter.pyd
> _winreg.pyd
> 
> And here is the import statement I added to the main python file to
> make this thing include all the necessary pygtk stuff:
> import pygtk, atk, gtk._gtk, pango
> 
> Any insight into what's missing would be greatly appreciated!
> 
> Thanks,
> Tom
> _______________________________________________
> pygtk mailing list   [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> 


-- 
Christopher Lambacher
[EMAIL PROTECTED]
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to