freeze.py and GTK apps

Adam DePrince adam.deprince at gmail.com
Tue Mar 28 11:11:10 EST 2006


On Mon, 2006-03-27 at 16:15 -0800, kristian.hermansen at gmail.com wrote:
> After freezing a PYGTK app, I am unable to run it.  It this a common
> problem, because I could not find any documentation on it at all.
> 
> I tried freezing this example, which gets by the make as well, but
> running it results in a failure.  This is on Ubuntu Linux:
> http://www.moeraki.com/pygtktutorial/pygtk2tutorial/examples/helloworld.py
> 
> $ ./helloworld
> Traceback (most recent call last):
>   File "helloworld.py", line 7, in ?
>     import gtk
>   File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line
> 37, in ?    from _gtk import *
> ImportError: No module named _gtk
> 
> Any suggestions?
> --
> Kristian Hermansen
> 

>From the freeze README

A warning about shared library modules
--------------------------------------

When your Python installation uses shared library modules such as
_tkinter.pyd, these will not be incorporated in the frozen program.
 Again, the frozen program will work when you test it, but it won't
 work when you ship it to a site without a Python installation.

Freeze prints a warning when this is the case at the end of the
freezing process:

        Warning: unknown modules remain: ...

When this occurs, the best thing to do is usually to rebuild Python
using static linking only. Or use the approach described in the previous
section to declare a library path using sys.path, and place the modules
such as _tkinter.pyd there.

Same applies here ... 




More information about the Python-list mailing list