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

Michael Held michael.held at bc.biol.ethz.ch
Sat Jun 27 15:33:36 BST 2009


hi again,

I think I did not fully understood it: of course can I compress
everything and put it on a website/ftp. but is there a way to run an app
with compressed parts, e.g. resources or a lot of Python scripts? but
this is maybe not the right forum to discuss about...

yes, py2app will wrap everything! I have tested that and it's great!
just for PyQt4 I was not sure whether I compiled it as universal or
intel-only version...

cheers
michael



piotr maliński wrote:
> Zipped apps are common way to publish apps :) OS X can unzipp them and
> users can run the app. Another way is to make a disk image (DMG) and
> place the app in the disk image. Compressed DMG has the size close to a
> ZIP archive, and can have nice installer (a.k.a. copy to Applications),
> readmes etc.
> 
> 15MB Zipped is the "ok" size :)
> 
> As for the PyQt4 installer - you have to compile it, but the final
> py2app made app doesn't require for the user to install anything. The
> app will run on it's own :)
> 
> 
> W dniu 27 czerwca 2009 14:03 użytkownik Michael Held
> <michael.held at bc.biol.ethz.ch <mailto:michael.held at bc.biol.ethz.ch>>
> napisał:
> 
>     hi piotr,
> 
>     yes, it looks like PyQt4 is using a lot of Pythons standard packages, so
>     all the files in Contents/Resources/lib/python2.6/lib-dynload are most
>     probably needed...
> 
>     I zipped and got 70MB with Qt debug files (from 200MB)
>     and 15MB without (from 43MB).
>     is there a way to provide an .app file with zipped content which is
>     unzipped on the fly?
> 
>     currently there is not installer for PyQt4.5 on MacOS available, right?!
>     I was compiling everything from scratch (I am also working with
>     Stackless Python 2.6.2). I guess there is a way to compile PyQt4 in
>     universal mode... somehow ;-)
> 
>     thanks a lot again! :-)
>     cheers
>     michael
> 
> 
>     piotr maliński wrote:
>     > Debug libraries don't get excluded by "excludes" list so they will
>     have
>     > to be removed. Also the package includes everything needed to run it -
>     > also some Python components.
>     > /Contents/Resources/lib/ 9,5 MB in my case
>     > /Contents/Frameworks/  24,8 MB
>     >
>     > And it zipps to 12MB
>     >
>     > Note that the resulting binary has some symlinks (in libs for example)
>     > and calculating size on Mac OS X will count the symlinked (alias)
>     files
>     > in :) So check zipped size :)
>     >
>     > If you used Qt with Qt Creator or custom Qt compilation on Intel Mac
>     > then you have Intel-only Qt and you will get Intell only App. If you
>     > used the Qt DMG without Qt Creator then you got Universal Qt and your
>     > app will be universal and DOUBLE size :) (22-24MB Zipped for
>     > qtcore/qtgui app).
>     >
>     >
>     > 2009/6/27 Michael Held <michael.held at bc.biol.ethz.ch
>     <mailto:michael.held at bc.biol.ethz.ch>
>     > <mailto:michael.held at bc.biol.ethz.ch
>     <mailto:michael.held at bc.biol.ethz.ch>>>
>     >
>     >     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
>     >     overhead.
>     >
>     >     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?
>     >
>     >     cheers
>     >     michael
>     >
>     >
>     >
>     >     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>
>     >     <mailto:michael.held at bc.biol.ethz.ch
>     <mailto:michael.held at bc.biol.ethz.ch>>
>     >     > <mailto:michael.held at bc.biol.ethz.ch
>     <mailto:michael.held at bc.biol.ethz.ch>
>     >     <mailto: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>
>     >     <mailto:PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>>
>     >     >     <mailto:PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>
>     >     <mailto:PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>>>
>     >     >     http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>     >     >
>     >     >
>     >
>     >     _______________________________________________
>     >     PyQt mailing list    PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>
>     >     <mailto:PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>>
>     >     http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>     >
>     >
> 
>     _______________________________________________
>     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