473,490 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

freeze.py builds, but binary doesn't even run locally (shared GTK problem?)

keherman@ibmlnx20:/tmp$ cat helloworld.py

#!/usr/bin/env python

import pygtk

pygtk.require('2.0')

import gtk

class HelloWorld:

def __init__(self):

self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)

self.window.show()

def main(self):

gtk.main()

if __name__ == "__main__":

hello = HelloWorld()

hello.main()

keherman@ibmlnx20:/tmp$
/usr/share/doc/python2.4/examples/Tools/freeze/freeze.py
helloworld.py

Name File

---- ----

m BaseHTTPServer /usr/lib/python2.4/BaseHTTPServer.py

m FixTk /usr/lib/python2.4/lib-tk/FixTk.py

m SocketServer /usr/lib/python2.4/SocketServer.py

m StringIO /usr/lib/python2.4/StringIO.py

m Tkconstants /usr/lib/python2.4/lib-tk/Tkconstants.py

m Tkinter /usr/lib/python2.4/lib-tk/Tkinter.py

m UserDict /usr/lib/python2.4/UserDict.py

m __builtin__

m __main__ helloworld.py

m _codecs

m _locale /usr/lib/python2.4/lib-dynload/_locale.so

m _random /usr/lib/python2.4/lib-dynload/_random.so

m _socket /usr/lib/python2.4/lib-dynload/_socket.so

m _sre

m _ssl /usr/lib/python2.4/lib-dynload/_ssl.so

m _threading_local /usr/lib/python2.4/_threading_local.py

m _tkinter /usr/lib/python2.4/lib-dynload/_tkinter.so

m array /usr/lib/python2.4/lib-dynload/array.so

m atexit /usr/lib/python2.4/atexit.py

m base64 /usr/lib/python2.4/base64.py

m binascii /usr/lib/python2.4/lib-dynload/binascii.so

m cStringIO /usr/lib/python2.4/lib-dynload/cStringIO.so

m codecs /usr/lib/python2.4/codecs.py

m collections
/usr/lib/python2.4/lib-dynload/collections.so

m copy /usr/lib/python2.4/copy.py

m copy_reg /usr/lib/python2.4/copy_reg.py

m dis /usr/lib/python2.4/dis.py

P distutils /usr/lib/python2.4/distutils/__init__.py

m distutils.dep_util /usr/lib/python2.4/distutils/dep_util.py

m distutils.errors /usr/lib/python2.4/distutils/errors.py

m distutils.log /usr/lib/python2.4/distutils/log.py

m distutils.spawn /usr/lib/python2.4/distutils/spawn.py

m distutils.util /usr/lib/python2.4/distutils/util.py

m dummy_thread /usr/lib/python2.4/dummy_thread.py

P email /usr/lib/python2.4/email/__init__.py

m email.Charset /usr/lib/python2.4/email/Charset.py

m email.Encoders /usr/lib/python2.4/email/Encoders.py

m email.Errors /usr/lib/python2.4/email/Errors.py

m email.FeedParser /usr/lib/python2.4/email/FeedParser.py

m email.Generator /usr/lib/python2.4/email/Generator.py

m email.Header /usr/lib/python2.4/email/Header.py

m email.Iterators /usr/lib/python2.4/email/Iterators.py

m email.Message /usr/lib/python2.4/email/Message.py

m email.Parser /usr/lib/python2.4/email/Parser.py

m email.Utils /usr/lib/python2.4/email/Utils.py

m email._parseaddr /usr/lib/python2.4/email/_parseaddr.py

m email.base64MIME /usr/lib/python2.4/email/base64MIME.py

m email.quopriMIME /usr/lib/python2.4/email/quopriMIME.py

P encodings /usr/lib/python2.4/encodings/__init__.py

m encodings.aliases /usr/lib/python2.4/encodings/aliases.py

m errno

m exceptions

m fcntl /usr/lib/python2.4/lib-dynload/fcntl.so

m fnmatch /usr/lib/python2.4/fnmatch.py

m formatter /usr/lib/python2.4/formatter.py

m ftplib /usr/lib/python2.4/ftplib.py

m getopt /usr/lib/python2.4/getopt.py

m getpass /usr/lib/python2.4/getpass.py

m glob /usr/lib/python2.4/glob.py

m gobject
/usr/lib/python2.4/site-packages/gtk-2.0/gobject.so

m gopherlib /usr/lib/python2.4/gopherlib.py

P gtk
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py

m gtk._gtk
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so

m gtk.keysyms
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/keysyms.py

m htmlentitydefs /usr/lib/python2.4/htmlentitydefs.py

m htmllib /usr/lib/python2.4/htmllib.py

m httplib /usr/lib/python2.4/httplib.py

m imp

m inspect /usr/lib/python2.4/inspect.py

m itertools /usr/lib/python2.4/lib-dynload/itertools.so

m linecache /usr/lib/python2.4/linecache.py

m locale /usr/lib/python2.4/locale.py

m macpath /usr/lib/python2.4/macpath.py

m macurl2path /usr/lib/python2.4/macurl2path.py

m markupbase /usr/lib/python2.4/markupbase.py

m marshal

m math /usr/lib/python2.4/lib-dynload/math.so

m mimetools /usr/lib/python2.4/mimetools.py

m mimetypes /usr/lib/python2.4/mimetypes.py

m ntpath /usr/lib/python2.4/ntpath.py

m nturl2path /usr/lib/python2.4/nturl2path.py

m opcode /usr/lib/python2.4/opcode.py

m os /usr/lib/python2.4/os.py

m os2emxpath /usr/lib/python2.4/os2emxpath.py

m popen2 /usr/lib/python2.4/popen2.py

m posix

m posixpath /usr/lib/python2.4/posixpath.py

m pwd /usr/lib/python2.4/lib-dynload/pwd.so

m py_compile /usr/lib/python2.4/py_compile.py

m pydoc /usr/lib/python2.4/pydoc.py

m pygtk /usr/lib/python2.4/site-packages/pygtk.py

m quopri /usr/lib/python2.4/quopri.py

m random /usr/lib/python2.4/random.py

m re /usr/lib/python2.4/re.py

m repr /usr/lib/python2.4/repr.py

m rfc822 /usr/lib/python2.4/rfc822.py

m select /usr/lib/python2.4/lib-dynload/select.so

m sgmllib /usr/lib/python2.4/sgmllib.py

m site /usr/lib/python2.4/site.py

m socket /usr/lib/python2.4/socket.py

m sre /usr/lib/python2.4/sre.py

m sre_compile /usr/lib/python2.4/sre_compile.py

m sre_constants /usr/lib/python2.4/sre_constants.py

m sre_parse /usr/lib/python2.4/sre_parse.py

m stat /usr/lib/python2.4/stat.py

m string /usr/lib/python2.4/string.py

m strop /usr/lib/python2.4/lib-dynload/strop.so

m struct /usr/lib/python2.4/lib-dynload/struct.so

m sys

m tempfile /usr/lib/python2.4/tempfile.py

m termios /usr/lib/python2.4/lib-dynload/termios.so

m thread

m threading /usr/lib/python2.4/threading.py

m time /usr/lib/python2.4/lib-dynload/time.so

m token /usr/lib/python2.4/token.py

m tokenize /usr/lib/python2.4/tokenize.py

m traceback /usr/lib/python2.4/traceback.py

m tty /usr/lib/python2.4/tty.py

m types /usr/lib/python2.4/types.py

m urllib /usr/lib/python2.4/urllib.py

m urlparse /usr/lib/python2.4/urlparse.py

m uu /usr/lib/python2.4/uu.py

m warnings /usr/lib/python2.4/warnings.py

m webbrowser /usr/lib/python2.4/webbrowser.py

Missing modules:

? Carbon.File imported from macpath

? Carbon.Folder imported from tempfile

? Carbon.Folders imported from tempfile

? EasyDialogs imported from getpass

? MacOS imported from Tkinter, py_compile

? SOCKS imported from ftplib

? _emx_link imported from os

? _winreg imported from urllib

? ce imported from os

? gdk imported from gtk

? ic imported from pydoc, urllib, webbrowser

? ltihooks imported from gtk

? mac imported from os

? msvcrt imported from getpass

? nt imported from ntpath, os

? org.python.core imported from copy

? os.path imported from os

? os2 imported from os

? riscos imported from os

? riscosenviron imported from os

? riscospath imported from os

? rourl2path imported from urllib

? sitecustomize imported from site

freezing BaseHTTPServer ...

freezing FixTk ...

freezing SocketServer ...

freezing StringIO ...

freezing Tkconstants ...

freezing Tkinter ...

freezing UserDict ...

freezing __main__ ...

freezing _threading_local ...

freezing atexit ...

freezing base64 ...

freezing codecs ...

freezing copy ...

freezing copy_reg ...

freezing dis ...

freezing distutils ...

freezing distutils.dep_util ...

freezing distutils.errors ...

freezing distutils.log ...

freezing distutils.spawn ...

freezing distutils.util ...

freezing dummy_thread ...

freezing email ...

freezing email.Charset ...

freezing email.Encoders ...

freezing email.Errors ...

freezing email.FeedParser ...

freezing email.Generator ...

freezing email.Header ...

freezing email.Iterators ...

freezing email.Message ...

freezing email.Parser ...

freezing email.Utils ...

freezing email._parseaddr ...

freezing email.base64MIME ...

freezing email.quopriMIME ...

freezing encodings ...

freezing encodings.aliases ...

freezing fnmatch ...

freezing formatter ...

freezing ftplib ...

freezing getopt ...

freezing getpass ...

freezing glob ...

freezing gopherlib ...

freezing gtk ...

freezing gtk.keysyms ...

freezing htmlentitydefs ...

freezing htmllib ...

freezing httplib ...

freezing inspect ...

freezing linecache ...

freezing locale ...

freezing macpath ...

freezing macurl2path ...

freezing markupbase ...

freezing mimetools ...

freezing mimetypes ...

freezing ntpath ...

freezing nturl2path ...

freezing opcode ...

freezing os ...

freezing os2emxpath ...

freezing popen2 ...

freezing posixpath ...

freezing py_compile ...

freezing pydoc ...

freezing pygtk ...

freezing quopri ...

freezing random ...

freezing re ...

freezing repr ...

freezing rfc822 ...

freezing sgmllib ...

freezing site ...

freezing socket ...

freezing sre ...

freezing sre_compile ...

freezing sre_constants ...

freezing sre_parse ...

freezing stat ...

freezing string ...

freezing tempfile ...

freezing threading ...

freezing token ...

freezing tokenize ...

freezing traceback ...

freezing tty ...

freezing types ...

freezing urllib ...

freezing urlparse ...

freezing uu ...

freezing warnings ...

freezing webbrowser ...

generating table of frozen modules

Warning: unknown modules remain: _locale _random _socket _ssl _tkinter
array binascii cStringIO collections fcntl gobject gtk._gtk itertools
math pwd select strop struct termios time

Now run "make" to build the target: helloworld

keherman@ibmlnx20:/tmp$ make

gcc -pthread -Xlinker -export-dynamic config.o frozen.o
M_BaseHTTPServer.o M_FixTk.o M_SocketServer.o M_StringIO.o
M_Tkconstants.o M_Tkinter.o M_UserDict.o M___main__.o
M__threading_local.o M_atexit.o M_base64.o M_codecs.o M_copy.o
M_copy_reg.o M_dis.o M_distutils.o M_distutils__dep_util.o
M_distutils__errors.o M_distutils__log.o M_distutils__spawn.o
M_distutils__util.o M_dummy_thread.o M_email.o M_email__Charset.o
M_email__Encoders.o M_email__Errors.o M_email__FeedParser.o
M_email__Generator.o M_email__Header.o M_email__Iterators.o
M_email__Message.o M_email__Parser.o M_email__Utils.o
M_email___parseaddr.o M_email__base64MIME.o M_email__quopriMIME.o
M_encodings.o M_encodings__aliases.o M_fnmatch.o M_formatter.o
M_ftplib.o M_getopt.o M_getpass.o M_glob.o M_gopherlib.o M_gtk.o
M_gtk__keysyms.o M_htmlentitydefs.o M_htmllib.o M_httplib.o M_inspect.o
M_linecache.o M_locale.o M_macpath.o M_macurl2path.o M_markupbase.o
M_mimetools.o M_mimetypes.o M_ntpath.o M_nturl2path.o M_opcode.o M_os.o
M_os2emxpath.o M_popen2.o M_posixpath.o M_py_compile.o M_pydoc.o
M_pygtk.o M_quopri.o M_random.o M_re.o M_repr.o M_rfc822.o M_sgmllib.o
M_site.o M_socket.o M_sre.o M_sre_compile.o M_sre_constants.o
M_sre_parse.o M_stat.o M_string.o M_tempfile.o M_threading.o M_token.o
M_tokenize.o M_traceback.o M_tty.o M_types.o M_urllib.o M_urlparse.o
M_uu.o M_warnings.o M_webbrowser.o
/usr/lib/python2.4/config/libpython2.4.a -lpthread -ldl -lutil -lm
-o helloworld

/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function
`posix_tmpnam':

: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'

/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function
`posix_tempnam':

: warning: the use of `tempnam' is dangerous, better use `mkstemp'

keherman@ibmlnx20:/tmp$ ./helloworld

Traceback (most recent call last):

File "helloworld.py", line 5, 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

Apr 8 '06 #1
1 2458
kr****************@gmail.com wrote:
from _gtk import *

ImportError: No module named _gtk


If you look at the freeze output, you'll notice that _gtk is
not linked into your application: It is a shared library (.so),
so it can't be frozen.

Instead, the resulting binary will look for _gtk.so on sys.path.
Try copying _gtk.so into the directory where the binary is,
or set PYTHONPATH before running the binary.

If you want to freeze _gtk into the application, you need it as
a static library.

Regards,
Martin
Apr 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

103
48475
by: Steven T. Hatton | last post by:
§27.4.2.1.4 Type ios_base::openmode Says this about the std::ios::binary openmode flag: *binary*: perform input and output in binary mode (as opposed to text mode) And that is basically _all_ it...
2
2129
by: kristian.hermansen | last post by:
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...
31
2346
by: pinkfloydhomer | last post by:
Using rand() in and old version og gcc, and using Tausworth's method, I calculated the frequency of 0 or 1 in the first digit like this: int hist = {0,0}; for (i = 0; i < 100000; ++i) {...
1
1674
by: guy.flowers | last post by:
Hi Have a problem, Ill give some history to the problem and add a little example code to start with to see if anybody can help or if I am correct in what the problem is. I have been looking...
1
3163
by: jmalone | last post by:
I have a python script that I need to freeze on AIX 5.1 (customer has AIX and does not want to install Python). The python script is pretty simple (the only things it imports are sys and socket)....
2
1613
by: Flyzone | last post by:
Hi, i need to "compile" a python source (2.3.6) to make it standalone on Solaris 9. I get this warning on freezing my source: "Warning: unknown modules remain: _locale _random _socket array...
0
1070
by: jm.suresh | last post by:
I am trying to use freeze to create a single binary executable for one of my program. When I run freeze, it runs fine with the following modules. These modules are available in the dyn-load...
16
4458
by: Erwin Moller | last post by:
Why is a binary file executable? Is any binary file executable? Is only binary file executable? Are all executable files binary? What is the connection between the attribute of binary and that of...
11
3777
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.