Hi,<br><br>Have you tried adding "PyQt4", "PyQt4.QtGui" and "PyQt4.QtCore" to your list of excludes?<br>(Maybe only "PyQt4.QtGui" is sufficient.)<br><br> Almar<br><br><br><div class="gmail_quote">
On 14 September 2010 13:02, Carlos Grohmann <span dir="ltr"><<a href="mailto:carlos.grohmann@gmail.com">carlos.grohmann@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello all,<br>
<br>
i've been trying to build an .exe with py2exe. After many tentatives,<br>
it worked, but the total space used by the app goes to 30Mb. It is a<br>
simple app, that uses wxpython, matplotlib and numpy. I checked the<br>
library.zip file and notived that there is a pyQt-related file there:<br>
<br>
Pyqt - QtGui.pyo - 8 Mb<br>
<br>
I'm not using Qt at all, so I assume it would be safe to not have this<br>
file, but I don't see how to do it.<br>
<br>
my setup.py file follows.<br>
<br>
many thanks<br>
<br>
Carlos<br>
<br>
<br>
#----------------------------------------------------------------------<br>
from distutils.core import setup<br>
import py2exe<br>
from glob import glob<br>
<br>
# Remove the build folder, a bit slower but ensures that build<br>
contains the latest<br>
import shutil<br>
shutil.rmtree("build", ignore_errors=True)<br>
<br>
# my setup.py is based on one generated with gui2exe, so data_files is<br>
done a bit differently<br>
data_files = [("Microsoft.VC90.CRT", glob(r'c:\dev\*.*'))]<br>
<br>
includes = ['wx', 'os', 'sys', 'csv', 're', 'floatspin',<br>
'scrolledpanel', 'customtreectrl',<br>
'wx.lib.expando', 'wx.lib.pubsub', 'wx.lib.embeddedimage',<br>
'wx.lib.wordwrap', 'types',<br>
'matplotlib', 'matplotlib.pyplot', 'matplotlib.axes',<br>
'matplotlib.figure',<br>
'matplotlib.backends.backend_wxagg',<br>
'mpl_toolkits.axes_grid.axislines', 'mpl_toolkits.axes_grid',<br>
'matplotlib.patches', 'matplotlib.lines',<br>
'matplotlib.text', 'matplotlib.mlab', 'matplotlib.nxutils',<br>
'matplotlib.collections', 'matplotlib.font_manager',<br>
'numpy', '<a href="http://numpy.ma" target="_blank">numpy.ma</a>', 'numpy.linalg', 'math', 'scipy.interpolate'<br>
]<br>
<br>
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'pywin.debugger',<br>
'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',<br>
'Tkconstants', 'Tkinter', 'pydoc', 'doctest', 'test',<br>
'sqlite3',<br>
'bsddb', 'curses', 'email','_fltkagg', '_gtk',<br>
'_gtkcairo',<br>
'_agg2', '_cairo', '_cocoaagg',<br>
'matplotlib.backends.backend_qt4agg','matplotlib.backends.backend_qt4'<br>
]<br>
<br>
packages = ['encodings','pytz','scipy']<br>
<br>
dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll',<br>
'tcl84.dll', 'tk84.dll',<br>
'libgdk_pixbuf-2.0-0.dll', 'libgtk-win32-2.0-0.dll',<br>
'libglib-2.0-0.dll',<br>
'libcairo-2.dll', 'libpango-1.0-0.dll',<br>
'libpangowin32-1.0-0.dll', 'libpangocairo-1.0-0.dll',<br>
'libglade-2.0-0.dll', 'libgmodule-2.0-0.dll',<br>
'libgthread-2.0-0.dll', 'QtGui4.dll', 'QtCore.dll',<br>
'QtCore4.dll'<br>
]<br>
<br>
icon_resources = []<br>
bitmap_resources = []<br>
other_resources = []<br>
<br>
# add the mpl mpl-data folder and rc file<br>
import matplotlib as mpl<br>
data_files += mpl.get_py2exe_datafiles()<br>
<br>
setup(<br>
windows=['OpenStereo.py'],<br>
# compressed and optimize reduce the size<br>
options = {"py2exe": {"compressed": 2,<br>
"optimize": 2,<br>
"includes": includes,<br>
"excludes": excludes,<br>
"packages": packages,<br>
"dll_excludes": dll_excludes,<br>
# using 2 to reduce number of files in dist<br>
folder<br>
# using 1 is not recommended as it often<br>
does not work<br>
"bundle_files": 2,<br>
"dist_dir": 'dist',<br>
"xref": False,<br>
"skip_archive": False,<br>
"ascii": False,<br>
"custom_boot_script": '',<br>
}<br>
},<br>
<br>
# using zipfile to reduce number of files in dist<br>
zipfile = r'lib\library.zip',<br>
<br>
data_files=data_files<br>
)<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>