freeze.py and GTK apps

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kristian.hermansen@gmail.com

    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:


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

  • Adam DePrince

    #2
    Re: freeze.py and GTK apps

    On Mon, 2006-03-27 at 16:15 -0800, kristian.herman sen@gmail.com wrote:[color=blue]
    > 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
    >[/color]
    [color=blue]
    >From the freeze README[/color]

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

    Comment

    • Kristian Hermansen

      #3
      Re: freeze.py and GTK apps

      On 3/28/06, Adam DePrince <adam.deprince@ gmail.com> wrote:[color=blue]
      > 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.[/color]

      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?
      [color=blue]
      > 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 ...[/color]

      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

      Comment

      Working...