From: Michael T. <mic...@gm...> - 2005-04-11 12:17:44
|
Hi, I've had some fun building py2exe stuff with matplotlib too, see below for some comments and help. On Apr 10, 2005 10:31 PM, and...@ti... <and...@ti...> wrote: > Hello NG, > > I found where the incompatibilities between Matplotlib and py2exe reside, > at least on my configuration (Windows XP or 2000, Matplotlib 0.74 or 0.72pre, > wxPython 2.5.5.1 or previous). The following line in dates.py: > > UTC = timezone('UTC') (line 94) > > Breaks the executable with the error "Unknown timezone" or something similar. > I've encountered this one before, it's to do with the pytz module and py2exe's modulefinder. Basically pytz dynamically imports modules, so py2exe has some difficulty with it. For my pyexe I added the following to the includes list: "pytz", "pytz.zoneinfo", "pytz.zoneinfo.UTC", "pytz.zoneinfo.US", "pytz.zoneinfo.US.Eastern", "pytz.zoneinfo.US.Central", "pytz.zoneinfo.US.Mountain", "pytz.zoneinfo.US.Pacific", "pytz.zoneinfo.Europe.London", "pytz.zoneinfo.Europe.Paris", "pytz.zoneinfo.Europe.Berlin", "pytz.zoneinfo.Europe.Moscow", For me this seemed to cover all the timezones I encountered. > Next, the way the Matplotlib developers are handling docstrings in pylab.py > (and others), like: > > figimage.__doc__ = Figure.figimage.__doc__ + """ > Addition kwargs: hold = [True|False] overrides default hold state""" > > Breaks py2exe with an error like: > > "Can not concatenate NoneType with str" > > I just commented out these lines because I don't need docstrings in my executable, > but if someone has a better idea, I welcome all suggestions. > I've never seen this one before, it might be because I'm building with an older copy of matplotlib. For reference here is my complete set of matplotlib includes: "encodings", "encodings.ascii", "encodings.idna", "encodings.iso8859_1", "encodings.utf_8", "encodings.string_escape", "matplotlib", "matplotlib._na_image", "matplotlib._na_transforms", "matplotlib._nc_image", "matplotlib._nc_transforms", "matplotlib.ft2font", "matplotlib.backends", "matplotlib.backends._backend_agg", "matplotlib.backends._tkagg", "matplotlib.backends._gtkagg", "matplotlib.backends.backend_agg", "matplotlib.backends.backend_tkagg", "matplotlib.backends.backend_gtkagg", "matplotlib.numerix", "matplotlib.numerix.fft", "matplotlib.numerix.linear_algebra", "matplotlib.numerix.mlab", "matplotlib.numerix.random_array", "pytz", "pytz.zoneinfo", "pytz.zoneinfo.UTC", "pytz.zoneinfo.US", "pytz.zoneinfo.US.Eastern", "pytz.zoneinfo.US.Central", "pytz.zoneinfo.US.Mountain", "pytz.zoneinfo.US.Pacific", "pytz.zoneinfo.Europe.London", "pytz.zoneinfo.Europe.Paris", "pytz.zoneinfo.Europe.Berlin", "pytz.zoneinfo.Europe.Moscow", "numarray", "numarray.convolve._correlate", "numarray.convolve._lineshape", "numarray.fft.fftpack", "numarray.image._combine", "numarray.linear_algebra.lapack_lite2", "numarray.nd_image._nd_image", "numarray.random_array.ranlib2", "numarray._bytes", "numarray._chararray", "numarray._conv", "numarray._converter", "numarray._ndarray", "numarray._numarray", "numarray._objectarray", "numarray._operator", "numarray._sort", "numarray._ufunc", "numarray._ufuncBool", "numarray._ufuncComplex32", "numarray._ufuncComplex64", "numarray._ufuncFloat32", "numarray._ufuncFloat64", "numarray._ufuncInt16", "numarray._ufuncInt32", "numarray._ufuncInt64", "numarray._ufuncInt8", "numarray._ufuncUInt16", "numarray._ufuncUInt32", "numarray._ufuncUInt8", "numarray.libnumarray", "numarray.libnumeric", "numarray.memory", I don't use numeric so I can't comment on the includes there (I have a half hearted attempt, but I don't think it's complete). regards, Michael |