[PyQt] Cx_freeze

Christoph Thielecke christoph.thielecke at gmx.de
Mon Jun 11 18:32:51 BST 2007


Hello Miguel,

> There are two approaches that I know of to get a single binary:
>
> - Some tools (I think py2exe) create a binary that self-extracts on
> execution; it writes the interpreter, the source code and the dynamic
> libraries to a temporary directory and then runs your program.
Maybe a solution but seems only available on win32.

> - If you want an actual statically linked single binary, I think the only
> option is to use freeze.  In fact that is the whole reason I wrote that
> patch -- I didn't like the self-extraction option.
I dont like it too, so I want to get freeze running.

> Also I looked around and found freeze, which is included in Python. It has
>
> > problems with submodules (most ppl will remember) and a patch made this
> > working (under win32). I try to get it working under Linux but I had no
> > success.
> > Does has someone got it working under Linux? It would be nice if this
> > would
> > work and the patch for all OS could be merged into Python 2.5.1 ;)
>
> Also I looked around and found freeze, which is included in Python. It has
>
> > problems with submodules (most ppl will remember) and a patch made this
> > working (under win32). I try to get it working under Linux but I had no
> > success.
>
> As far as I can see, the fix for submodules itself should work under Linux.
Thanks. Btw; Are you on irc? Then we could talk there too....

I cant get it running; it still claims about unknown modules...

> What does not work is the regression test (or rather, the configuration of
> Python's build system to run that test). 
Right:
checking for build directories... done
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Modules/Setup.config
config.status: creating pyconfig.h
config.status: pyconfig.h is unchanged
creating Modules/Setup
creating Modules/Setup.local
creating Makefile
bad word xxsubtype.xxsubmoduletest in xxsubtype.xxsubmoduletest 
xxsubmoduletest.c
mv: cannot stat `config.c': No such file or directory


> If you could please let me know 
> what the error messages are, I think I should be able to help you with the
> Linux build.

Here is a log after removing the test case from Setup.dist and try to freeze 
my app:

/usr/local/bin/python2.5 ~/compile/PYthon-2.5/Tools/freeze/freeze.py  
myprog.py

  Name                      File
  ----                      ----
m BaseHTTPServer            /usr/local/lib/python2.5/BaseHTTPServer.py
m FixTk                     /usr/local/lib/python2.5/lib-tk/FixTk.py
P 
PyQt4                     /usr/local/lib/python2.5/site-packages/PyQt4/__init__.py
m 
PyQt4.QtCore              /usr/local/lib/python2.5/site-packages/PyQt4/QtCore.so
m 
PyQt4.QtGui               /usr/local/lib/python2.5/site-packages/PyQt4/QtGui.so
m SocketServer              /usr/local/lib/python2.5/SocketServer.py
m StringIO                  /usr/local/lib/python2.5/StringIO.py
m Tkconstants               /usr/local/lib/python2.5/lib-tk/Tkconstants.py
m Tkinter                   /usr/local/lib/python2.5/lib-tk/Tkinter.py
m UserDict                  /usr/local/lib/python2.5/UserDict.py
m __builtin__
m __future__                /usr/local/lib/python2.5/__future__.py
m __main__                  yfinite_firmware_installer_qt.py
m _bisect                   /usr/local/lib/python2.5/lib-dynload/_bisect.so
m _codecs
m _heapq                    /usr/local/lib/python2.5/lib-dynload/_heapq.so
m _locale                   /usr/local/lib/python2.5/lib-dynload/_locale.so
m _random                   /usr/local/lib/python2.5/lib-dynload/_random.so
m _socket                   /usr/local/lib/python2.5/lib-dynload/_socket.so
m _sre
m _ssl                      /usr/local/lib/python2.5/lib-dynload/_ssl.so
m _struct                   /usr/local/lib/python2.5/lib-dynload/_struct.so
m _threading_local          /usr/local/lib/python2.5/_threading_local.py
m _tkinter                  /usr/local/lib/python2.5/lib-dynload/_tkinter.so
m _types
m array                     /usr/local/lib/python2.5/lib-dynload/array.so
m atexit                    /usr/local/lib/python2.5/atexit.py
m base64                    /usr/local/lib/python2.5/base64.py
m bdb                       /usr/local/lib/python2.5/bdb.py
m binascii                  /usr/local/lib/python2.5/lib-dynload/binascii.so
m bisect                    /usr/local/lib/python2.5/bisect.py
m bz2                       /usr/local/lib/python2.5/lib-dynload/bz2.so
m cStringIO                 /usr/local/lib/python2.5/lib-dynload/cStringIO.so
m calendar                  /usr/local/lib/python2.5/calendar.py
m cmd                       /usr/local/lib/python2.5/cmd.py
m codecs                    /usr/local/lib/python2.5/codecs.py
m 
collections               /usr/local/lib/python2.5/lib-dynload/collections.so
m copy                      /usr/local/lib/python2.5/copy.py
m copy_reg                  /usr/local/lib/python2.5/copy_reg.py
m datetime                  /usr/local/lib/python2.5/lib-dynload/datetime.so
m difflib                   /usr/local/lib/python2.5/difflib.py
m dis                       /usr/local/lib/python2.5/dis.py
P distutils                 /usr/local/lib/python2.5/distutils/__init__.py
m distutils.dep_util        /usr/local/lib/python2.5/distutils/dep_util.py
m distutils.errors          /usr/local/lib/python2.5/distutils/errors.py
m distutils.log             /usr/local/lib/python2.5/distutils/log.py
m distutils.spawn           /usr/local/lib/python2.5/distutils/spawn.py
m distutils.sysconfig       /usr/local/lib/python2.5/distutils/sysconfig.py
m distutils.text_file       /usr/local/lib/python2.5/distutils/text_file.py
m distutils.util            /usr/local/lib/python2.5/distutils/util.py
m doctest                   /usr/local/lib/python2.5/doctest.py
m dummy_thread              /usr/local/lib/python2.5/dummy_thread.py
P email                     /usr/local/lib/python2.5/email/__init__.py
m email._parseaddr          /usr/local/lib/python2.5/email/_parseaddr.py
m email.base64mime          /usr/local/lib/python2.5/email/base64mime.py
m email.charset             /usr/local/lib/python2.5/email/charset.py
m email.encoders            /usr/local/lib/python2.5/email/encoders.py
m email.errors              /usr/local/lib/python2.5/email/errors.py
m email.feedparser          /usr/local/lib/python2.5/email/feedparser.py
m email.message             /usr/local/lib/python2.5/email/message.py
P email.mime                /usr/local/lib/python2.5/email/mime/__init__.py
m email.parser              /usr/local/lib/python2.5/email/parser.py
m email.quoprimime          /usr/local/lib/python2.5/email/quoprimime.py
m email.utils               /usr/local/lib/python2.5/email/utils.py
P encodings                 /usr/local/lib/python2.5/encodings/__init__.py
m encodings.aliases         /usr/local/lib/python2.5/encodings/aliases.py
m errno
m fcntl                     /usr/local/lib/python2.5/lib-dynload/fcntl.so
m fnmatch                   /usr/local/lib/python2.5/fnmatch.py
m formatter                 /usr/local/lib/python2.5/formatter.py
m ftplib                    /usr/local/lib/python2.5/ftplib.py
m ftplib2                   ftplib2.py
m getopt                    /usr/local/lib/python2.5/getopt.py
m getpass                   /usr/local/lib/python2.5/getpass.py
m gettext                   /usr/local/lib/python2.5/gettext.py
m glob                      /usr/local/lib/python2.5/glob.py
m gopherlib                 /usr/local/lib/python2.5/gopherlib.py
m grp                       /usr/local/lib/python2.5/lib-dynload/grp.so
m gzip                      /usr/local/lib/python2.5/gzip.py
m heapq                     /usr/local/lib/python2.5/heapq.py
m htmlentitydefs            /usr/local/lib/python2.5/htmlentitydefs.py
m htmllib                   /usr/local/lib/python2.5/htmllib.py
m httplib                   /usr/local/lib/python2.5/httplib.py
m imp
m inspect                   /usr/local/lib/python2.5/inspect.py
m itertools                 /usr/local/lib/python2.5/lib-dynload/itertools.so
m linecache                 /usr/local/lib/python2.5/linecache.py
m locale                    /usr/local/lib/python2.5/locale.py
m macpath                   /usr/local/lib/python2.5/macpath.py
m macurl2path               /usr/local/lib/python2.5/macurl2path.py
m markupbase                /usr/local/lib/python2.5/markupbase.py
m marshal
m math                      /usr/local/lib/python2.5/lib-dynload/math.so
m mimetools                 /usr/local/lib/python2.5/mimetools.py
m mimetypes                 /usr/local/lib/python2.5/mimetypes.py
m new                       /usr/local/lib/python2.5/new.py
m ntpath                    /usr/local/lib/python2.5/ntpath.py
m nturl2path                /usr/local/lib/python2.5/nturl2path.py
m opcode                    /usr/local/lib/python2.5/opcode.py
m operator                  /usr/local/lib/python2.5/lib-dynload/operator.so
m optparse                  /usr/local/lib/python2.5/optparse.py
m os                        /usr/local/lib/python2.5/os.py
m os2emxpath                /usr/local/lib/python2.5/os2emxpath.py
m pdb                       /usr/local/lib/python2.5/pdb.py
m pickle                    /usr/local/lib/python2.5/pickle.py
m pkgutil                   /usr/local/lib/python2.5/pkgutil.py
m popen2                    /usr/local/lib/python2.5/popen2.py
m posix
m posixpath                 /usr/local/lib/python2.5/posixpath.py
m pprint                    /usr/local/lib/python2.5/pprint.py
m pwd
m py_compile                /usr/local/lib/python2.5/py_compile.py
m pydoc                     /usr/local/lib/python2.5/pydoc.py
m quopri                    /usr/local/lib/python2.5/quopri.py
m random                    /usr/local/lib/python2.5/random.py
m re                        /usr/local/lib/python2.5/re.py
m readline                  /usr/local/lib/python2.5/lib-dynload/readline.so
m repr                      /usr/local/lib/python2.5/repr.py
m rfc822                    /usr/local/lib/python2.5/rfc822.py
m select                    /usr/local/lib/python2.5/lib-dynload/select.so
m sgmllib                   /usr/local/lib/python2.5/sgmllib.py
m shutil                    /usr/local/lib/python2.5/shutil.py
m site                      /usr/local/lib/python2.5/site.py
m socket                    /usr/local/lib/python2.5/socket.py
m sre_compile               /usr/local/lib/python2.5/sre_compile.py
m sre_constants             /usr/local/lib/python2.5/sre_constants.py
m sre_parse                 /usr/local/lib/python2.5/sre_parse.py
m stat                      /usr/local/lib/python2.5/stat.py
m string                    /usr/local/lib/python2.5/string.py
m strop                     /usr/local/lib/python2.5/lib-dynload/strop.so
m struct                    /usr/local/lib/python2.5/struct.py
m subprocess                /usr/local/lib/python2.5/subprocess.py
m sys
m tarfile                   /usr/local/lib/python2.5/tarfile.py
m tempfile                  /usr/local/lib/python2.5/tempfile.py
m termios                   /usr/local/lib/python2.5/lib-dynload/termios.so
m textwrap                  /usr/local/lib/python2.5/textwrap.py
m thread
m threading                 /usr/local/lib/python2.5/threading.py
m time                      /usr/local/lib/python2.5/lib-dynload/time.so
m token                     /usr/local/lib/python2.5/token.py
m tokenize                  /usr/local/lib/python2.5/tokenize.py
m traceback                 /usr/local/lib/python2.5/traceback.py
m tty                       /usr/local/lib/python2.5/tty.py
m types                     /usr/local/lib/python2.5/types.py
m unittest                  /usr/local/lib/python2.5/unittest.py
m urllib                    /usr/local/lib/python2.5/urllib.py
m urlparse                  /usr/local/lib/python2.5/urlparse.py
m uu                        /usr/local/lib/python2.5/uu.py
m warnings                  /usr/local/lib/python2.5/warnings.py
m webbrowser                /usr/local/lib/python2.5/webbrowser.py
m zipimport
m zlib                      /usr/local/lib/python2.5/lib-dynload/zlib.so

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, distutils.sysconfig, py_compile
? SOCKS imported from ftplib, ftplib2
? _emx_link imported from os
? _subprocess imported from subprocess
? _winreg imported from urllib
? ce imported from os
? email.Generator imported from email.message
? email.Iterators imported from email.message
? email.Utils imported from urllib
? ic imported from pydoc, urllib, webbrowser
? mac imported from os
? msvcrt imported from getpass, subprocess
? nt imported from ntpath, os
? org.python.core imported from copy, pickle
? os.path imported from __main__, os, pkgutil, shutil
? 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 PyQt4 ...
freezing SocketServer ...
freezing StringIO ...
freezing Tkconstants ...
freezing Tkinter ...
freezing UserDict ...
freezing __future__ ...
freezing __main__ ...
freezing _threading_local ...
freezing atexit ...
freezing base64 ...
freezing bdb ...
freezing bisect ...
freezing calendar ...
freezing cmd ...
freezing codecs ...
freezing copy ...
freezing copy_reg ...
freezing difflib ...
freezing dis ...
freezing distutils ...
freezing distutils.dep_util ...
freezing distutils.errors ...
freezing distutils.log ...
freezing distutils.spawn ...
freezing distutils.sysconfig ...
freezing distutils.text_file ...
freezing distutils.util ...
freezing doctest ...
freezing dummy_thread ...
freezing email ...
freezing email._parseaddr ...
freezing email.base64mime ...
freezing email.charset ...
freezing email.encoders ...
freezing email.errors ...
freezing email.feedparser ...
freezing email.message ...
freezing email.mime ...
freezing email.parser ...
freezing email.quoprimime ...
freezing email.utils ...
freezing encodings ...
freezing encodings.aliases ...
freezing fnmatch ...
freezing formatter ...
freezing ftplib ...
freezing ftplib2 ...
freezing getopt ...
freezing getpass ...
freezing gettext ...
freezing glob ...
freezing gopherlib ...
freezing gzip ...
freezing heapq ...
freezing htmlentitydefs ...
freezing htmllib ...
freezing httplib ...
freezing inspect ...
freezing linecache ...
freezing locale ...
freezing macpath ...
freezing macurl2path ...
freezing markupbase ...
freezing mimetools ...
freezing mimetypes ...
freezing new ...
freezing ntpath ...
freezing nturl2path ...
freezing opcode ...
freezing optparse ...
freezing os ...
freezing os2emxpath ...
freezing pdb ...
freezing pickle ...
freezing pkgutil ...
freezing popen2 ...
freezing posixpath ...
freezing pprint ...
freezing py_compile ...
freezing pydoc ...
freezing quopri ...
freezing random ...
freezing re ...
freezing repr ...
freezing rfc822 ...
freezing sgmllib ...
freezing shutil ...
freezing site ...
freezing socket ...
freezing sre_compile ...
freezing sre_constants ...
freezing sre_parse ...
freezing stat ...
freezing string ...
freezing struct ...
freezing subprocess ...
freezing tarfile ...
freezing tempfile ...
freezing textwrap ...
freezing threading ...
freezing token ...
freezing tokenize ...
freezing traceback ...
freezing tty ...
freezing types ...
freezing unittest ...
freezing urllib ...
freezing urlparse ...
freezing uu ...
freezing warnings ...
freezing webbrowser ...
generating table of frozen modules
Warning: unknown modules remain: PyQt4.QtCore PyQt4.QtGui _bisect _heapq 
_locale _random _socket _ssl _struct _tkinter array binascii bz2 cStringIO 
collections datetime fcntl grp itertools math operator readline select strop 
termios time zlib
Now run "make" to build the target: myprog

[compiling...]

./myprog
Traceback (most recent call last):
  File "myprog.py", line 27, in <module>
    from PyQt4 import QtGui
ImportError: cannot import name QtGui

> As for the inclusion of this patch into the Python official release, the
> patch needs to have this problem with the regression test configuration
> fixed, and being reviewed.  The difficult part is the latter as apparently
> barely anyone reviews Python patches and so the project has a considerable
> patch backlog.
If we got it working it should be a good feature :)


Best regards

Christoph
-- 
Linux User Group Wernigerode
http://www.lug-wr.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070611/3612a924/attachment.bin


More information about the PyQt mailing list