469,643 Members | 1,341 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

freeze.py and GTK apps

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.../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

Mar 28 '06 #1
2 2013
On Mon, 2006-03-27 at 16:15 -0800, kr****************@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.../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 ...

Mar 28 '06 #2
On 3/28/06, Adam DePrince <ad***********@gmail.com> wrote:
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.
No, it didn't even run!!! So, it won't run frozen on ANY system. The
_gtk import choked the whole program and it died with exit status ==
1. So, even though I did have the GTK libraries locally, the program
exited improperly. The unfrozen script ran fine, so isn't this a
different problem entirely?
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 ...


Well, what we want is a totally static frozen build, but if not
possible (GTK is huge right?), GTK is assumed to be on the target
machine. However, the frozen binary still doesn't run properly. Any
suggestions? Try freezing the example code yourself and running it,
perhaps I am doing something amazingly wrong here...
--
Kristian Hermansen
Mar 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by aww91 | last post: by
11 posts views Thread by Timothy Shih | last post: by
4 posts views Thread by Roger Withnell | last post: by
2 posts views Thread by paraidy | last post: by
1 post views Thread by jmalone | last post: by
1 post views Thread by Cameron Laird | last post: by
2 posts views Thread by Gabriel Rossetti | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.