From: Carl K. <ca...@pe...> - 2007-05-04 21:23:27
|
Rob Snyder wrote: > Hello All - > > I've used py2exe successfully many times in the past, but I've just started > running into a problem bundling up a wxPython/wxWindows application. No > matter what options I have tried, the resulting executable fails with: > > Traceback (most recent call last): > File "RolloverRDC.py", line 10, in ? > AttributeError: 'module' object has no attribute 'build' > > (RolloverRDC being the name of my program, naturally). > > I'm not even sure where to start looking for a solution, so I'd appreciate > any guidance anyone can provide. well, I just got a wx app to work (like a few hours ago) mainly by the help from others, and almost no understanding on my part, so no clue how good/bad this is, other than "it works." Carl K # setup.py # used by py2exe to build uLoop3.exe # not sure if I need all the icons, but it is less than a meg. from distutils.core import setup import py2exe import glob, os import dabo, dabo.icons # Find the location of the dabo icons: iconDir = os.path.split(dabo.icons.__file__)[0] iconSubDirs = [] def getIconSubDir(arg, dirname, fnames): if ".svn" not in dirname and dirname[-1] != "\\": icons = glob.glob(os.path.join(dirname, "*.png")) if icons: subdir = (os.path.join("resources", dirname[len(arg)+1:]), icons) iconSubDirs.append(subdir) os.path.walk(iconDir, getIconSubDir, iconDir) setup(console=['uloop3.py'], options={"py2exe": {"packages": [ "wx.gizmos", 'wx.lib.calendar', 'wx.lib.masked', 'wx.lib.buttons'], "optimize": 2, "excludes": ["Tkconstants","Tkinter","tcl", "_imagingtk", "PIL._imagingtk", "ImageTk", "PIL.ImageTk", "FixTk"]}}, data_files=[ ("resources", glob.glob(os.path.join(iconDir, "*.png"))) ] ) |