[PyQt] Re: py2app generates huge files (200MB)

Michael Held michael.held at bc.biol.ethz.ch
Sat Jun 27 12:26:09 BST 2009

hi piotr,

thanks a lot for your help!

aral balkan writes on his page that one "can remove the Qt debug files".
these are ~150MB in my case and the *biggest* part of the problem.
I guess I need to write a "better" Qt4 recipe for pyapp or I have to add
some kind of clean-up step after the execution of py2app...

furthermore Contents/Resources/lib/python2.6/lib-dynload contains ~14MB
of python packages which are not used by my "empty" script (and I assume
PyQt4 is not using those as well...

again, I am happy with a 40MB .app file but a 200MB file just to much

does anybody know how to tweak the PyQt4 recipe of py2app? I had a short
look on the code but could not find the right script.
or would it be helpful to work with the latest svn revision instead the
released version 0.3.6?


piotr maliński wrote:
> check out my tutorial:
> http://www.rkblog.rk.edu.pl/w/p/building-mac-os-x-applications-py2app/
> QtCore/QtGui app zipped should be about 12MB intel-only (22MB if you use
> Universal Qt - thus making universal py2app application)
> 2009/6/27 Michael Held <michael.held at bc.biol.ethz.ch
> <mailto:michael.held at bc.biol.ethz.ch>>
>     hi pyqt,
>     I am using PyQt4.5 and py2app 0.3.6 on MacOS 10.5
>     > from setuptools import setup
>     >
>     > APP = ['MyApp.py']
>     > DATA_FILES = []
>     > OPTIONS = {'argv_emulation': True,
>     >            'includes': [],
>     >            }
>     >
>     > setup(
>     >     app=APP,
>     >     data_files=DATA_FILES,
>     >     options={'py2app': OPTIONS},
>     >     setup_requires=['py2app'],
>     > )
>     running this setup.py PyQt4, sip and the Qt framework are detected and
>     the app runs fine,
>     *BUT* the app is 200MB (TWOHUNDRET MEGABYTES) big and its doing nothing
>     but opening an empty QFrame.
>     I looked into the app-contents and found a lot of debug stuff for the
>     QtGui/QtCore Frameworks.
>     after deleting these files the app was still running fine and only 42MB
>     big (I found a lot of Pyhton libs/packages in there which are not used
>     at all)
>     42MB for an "empty program" is ok, since all my scripts will not add
>     much size, but 200MB is just *too big*.
>     it looks like py2app is including a lot of unnecessary stuff...
>     could stackless Python 2.6.2 is the problem?
>     thanks a lot for your help!
>     michael
>     _______________________________________________
>     PyQt mailing list    PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>
>     http://www.riverbankcomputing.com/mailman/listinfo/pyqt

More information about the PyQt mailing list