last version that worked well with py2exe?

Hi I read on the py2exe wiki that the 0.83 line creates huge
distributions because of trouble excluding backends that are not
wanted.
  ( http://starship.python.net/crew/theller/moin.cgi/MatPlotLib )

I do need to have a small distribution on windows. Which version of
matplotlib was the last to play nicely with py2exe?

Has anyone had any luck with 0.83.3 and excluding tk and gtk backends?
(I'm using wx)

I'm also getting a strange dependancy on the unicode version of
wxPython, when I'm using the non-unicode version, and that's adding
another 5MB onto my distro.

Thanks,
-Jim

Using Matplotlib 0.87.3 (wxAgg backend), NumPy 0.9.8, SciPy 0.4.9,
wxPython unicode.2.6.3.2, python 2.4.3 the following setup.py worked
well with py2exe 0.6.5 on Widows XP:

···

#--------------------------------------------------------------
from distutils.core import setup
import py2exe
import glob

data = glob.glob(r'C:Documents and Settings\Apa\.matplotlib\*')
data.append(r'C:\Documents and Settings\Apa\.matplotlib\matplotlibrc')

includes = ['matplotlib.numerix.random_array',
            'pytz.zoneinfo.UTC',
            'scipy.misc.info']

excludes = ['Tkinter']

opts = {
    "py2exe": {
        'skip_archive': 1,
        'includes': includes,
        'excludes': excludes,
        'packages': ['numpy'],
    }
}

setup(
    windows = [
        {
            "script": 'Wynne.py',
            "icon_resources": [(1, 'THz.ico')]
        }
    ],
    data_files = [('matplotlibdata', data)],
    options = opts
    )
#--------------------------------------------------------------

Regards,
Géza

--
Géza Groma
Institute of Biophysics
Biological Research Center of the Hungarian Academy of Sciences
Temesvári krt. 62.
6701 Szeged, Hungary

phone: +36 62 599 620 fax: +36 62 433 133 cellular: +36 20 5648 303

On 6/28/06, James Carroll <mrmaple@...287...> wrote:

Hi I read on the py2exe wiki that the 0.83 line creates huge
distributions because of trouble excluding backends that are not
wanted.
( http://starship.python.net/crew/theller/moin.cgi/MatPlotLib )

I do need to have a small distribution on windows. Which version of
matplotlib was the last to play nicely with py2exe?

Has anyone had any luck with 0.83.3 and excluding tk and gtk backends?
(I'm using wx)

I'm also getting a strange dependancy on the unicode version of
wxPython, when I'm using the non-unicode version, and that's adding
another 5MB onto my distro.

Thanks,
-Jim

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I followed your example, and had some luck. Thanks.

My final distribution is 47MB in 840 files. Does anyone have an example that
does even better?

Last October, I used numarray + matplotlib in an almost identical
project, and managed to bundle it into 11MB and four files. But I
can't remember exactly the combination that I used.

If I try to use a zip file (comment out the skip_archive) to reduce
size and filecount, I get the error:

  File "matplotlib\backends\backend_wxagg.pyc", line 21, in ?
  File "matplotlib\figure.pyc", line 5, in ?
  File "matplotlib\artist.pyc", line 4, in ?
  File "matplotlib\transforms.pyc", line 215, in ?
  File "matplotlib\_transforms.pyc", line 1, in ?
  File "matplotlib\numerix\__init__.pyc", line 52, in ?
  File "numarray\__init__.pyc", line 42, in ?
  File "numarray\numarrayall.pyc", line 2, in ?
  File "numarray\generic.pyc", line 1120, in ?
  File "numarray\numarraycore.pyc", line 16, in ?
  File "numarray\_sort.pyc", line 12, in ?
  File "numarray\_sort.pyc", line 10, in __load
  File "numpy\__init__.pyc", line 35, in ?
  File "numpy\_import_tools.pyc", line 173, in __call__
  File "numpy\_import_tools.pyc", line 68, in _init_info_modules
  File "<string>", line 1, in ?
  File "numpy\random\__init__.pyc", line 3, in ?
  File "numpy\random\mtrand.pyc", line 12, in ?
  File "numpy\random\mtrand.pyc", line 10, in __load
  File "numpy.pxi", line 32, in mtrand
AttributeError: 'module' object has no attribute 'dtype'

and even in the working example where I do skip_archive, I get the warnings:

The following modules appear to be missing
['FFT', 'LinearAlgebra', 'MA', 'MLab', 'Matrix', 'Numeric', 'Pyrex', 'Pyrex.Comp
iler', 'RandomArray', 'backends.draw_if_interactive', 'backends.new_figure_manag
er', 'backends.pylab_setup', 'backends.show', 'cephes', 'fcompiler.FCompiler', '
fcompiler.show_fcompilers', 'genapi', 'lib.add_newdoc', 'numerix.ArrayType', 'nu
merix.Complex', 'numerix.Complex32', 'numerix.Complex64', 'numerix.Float', 'nume
rix.Float32', 'numerix.Float64', 'numerix.Int', 'numerix.Int16', 'numerix.Int32'
, 'numerix.Int8', 'numerix.NewAxis', 'numerix.UInt16', 'numerix.UInt32', 'numeri
x.UInt8', 'numerix.absolute', 'numerix.add', 'numerix.allclose', 'numerix.alltru
e', 'numerix.arange', 'numerix.arccos', 'numerix.arccosh', 'numerix.arcsin', 'nu
merix.arcsinh', 'numerix.arctan', 'numerix.arctan2', 'numerix.arctanh', 'numerix
.argmax', 'numerix.argmin', 'numerix.argsort', 'numerix.around', 'numerix.array'
, 'numerix.arrayrange', 'numerix.asarray', 'numerix.asum', 'numerix.bitwise_and'
, 'numerix.bitwise_or', 'numerix.bitwise_xor', 'numerix.ceil', 'numerix.choose',
'numerix.clip', 'numerix.compress', 'numerix.concatenate', 'numerix.conjugate',
'numerix.convolve', 'numerix.cos', 'numerix.cosh', 'numerix.cross_correlate', '
numerix.cumproduct', 'numerix.cumsum', 'numerix.diagonal', 'numerix.divide', 'nu
merix.dot', 'numerix.equal', 'numerix.exp', 'numerix.fabs', 'numerix.fft.fft', '
numerix.fft.inverse_fft', 'numerix.floor', 'numerix.fmod', 'numerix.fromfunction
', 'numerix.fromstring', 'numerix.greater', 'numerix.greater_equal', 'numerix.hy
pot', 'numerix.identity', 'numerix.indices', 'numerix.innerproduct', 'numerix.is
contiguous', 'numerix.less', 'numerix.less_equal', 'numerix.log', 'numerix.log10
', 'numerix.logical_and', 'numerix.logical_not', 'numerix.logical_or', 'numerix.
logical_xor', 'numerix.matrixmultiply', 'numerix.maximum', 'numerix.minimum', 'n
umerix.mlab.amax', 'numerix.mlab.amin', 'numerix.mlab.cov', 'numerix.mlab.diff',
'numerix.mlab.hanning', 'numerix.mlab.rand', 'numerix.mlab.std', 'numerix.mlab.
svd', 'numerix.multiply', 'numerix.negative', 'numerix.nonzero', 'numerix.not_eq
ual', 'numerix.nx', 'numerix.ones', 'numerix.outerproduct', 'numerix.pi', 'numer
ix.power', 'numerix.product', 'numerix.put', 'numerix.putmask', 'numerix.rank',
'numerix.ravel', 'numerix.repeat', 'numerix.reshape', 'numerix.resize', 'numerix
.searchsorted', 'numerix.shape', 'numerix.sin', 'numerix.sinh', 'numerix.size',
'numerix.sometrue', 'numerix.sort', 'numerix.sqrt', 'numerix.subtract', 'numerix
.swapaxes', 'numerix.take', 'numerix.tan', 'numerix.tanh', 'numerix.trace', 'num
erix.transpose', 'numerix.typecode', 'numerix.typecodes', 'numerix.where', 'nume
rix.which', 'numerix.zeros', 'numpy.Complex', 'numpy.Complex32', 'numpy.Complex6
4', 'numpy.Float', 'numpy.Float32', 'numpy.Float64', 'numpy.Inf', 'numpy.Infinit
y', 'numpy.Int', 'numpy.Int16', 'numpy.Int32', 'numpy.Int8', 'numpy.UInt16', 'nu
mpy.UInt32', 'numpy.UInt8', 'numpy.absolute', 'numpy.add', 'numpy.amax', 'numpy.
amin', 'numpy.arange', 'numpy.array', 'numpy.asarray', 'numpy.asarray_chkfinite'
, 'numpy.cast', 'numpy.concatenate', 'numpy.conjugate', 'numpy.diag', 'numpy.dot
', 'numpy.exp', 'numpy.extract', 'numpy.eye', 'numpy.finfo', 'numpy.float_', 'nu
mpy.floor', 'numpy.greater_equal', 'numpy.hstack', 'numpy.identity', 'numpy.imag
', 'numpy.inf', 'numpy.infty', 'numpy.insert', 'numpy.iscomplexobj', 'numpy.isfi
nite', 'numpy.log', 'numpy.log2', 'numpy.logical_not', 'numpy.matrix', 'numpy.mg
rid', 'numpy.newaxis', 'numpy.ogrid', 'numpy.ones', 'numpy.outerproduct', 'numpy
.pi', 'numpy.poly1d', 'numpy.product', 'numpy.r_', 'numpy.ravel', 'numpy.real',
'numpy.reshape', 'numpy.sign', 'numpy.single', 'numpy.sqrt', 'numpy.subtract', '
numpy.sum', 'numpy.take', 'numpy.transpose', 'numpy.typecodes', 'numpy.typename'
, 'numpy.where', 'numpy.zeros', 'numpy_distutils', 'numpy_distutils.command.buil
d_flib', 'numpy_distutils.command.cpuinfo', 'numpy_distutils.cpuinfo', 'numpy_di
stutils.fcompiler', 'pkg_resources', 'pre', 'setuptools', 'setuptools.command',
'setuptools.command.egg_info', 'matplotlib.numerix.Float', 'matplotlib.numerix.F
loat32', 'matplotlib.numerix.absolute', 'matplotlib.numerix.alltrue', 'matplotli
b.numerix.asarray', 'matplotlib.numerix.ceil', 'matplotlib.numerix.equal', 'matp
lotlib.numerix.fromstring', 'matplotlib.numerix.put', 'matplotlib.numerix.ravel'
, 'matplotlib.numerix.sqrt', 'matplotlib.numerix.take', 'matplotlib.numerix.tran
spose', 'matplotlib.numerix.where', 'numarray.Complex', 'numarray.Complex32', 'n

etc...

Help me please!

Thanks,
-Jim

···

On 6/28/06, Géza Groma <groma@...1111...> wrote:

Using Matplotlib 0.87.3 (wxAgg backend), NumPy 0.9.8, SciPy 0.4.9,
wxPython unicode.2.6.3.2, python 2.4.3 the following setup.py worked
well with py2exe 0.6.5 on Widows XP:

I think PyInstaller is supposed to help with this problem:
http://pyinstaller.hpcf.upr.edu/
But I have not used it.

Cheers,
Alan Isaac

···

On Wed, 28 Jun 2006, James Carroll apparently wrote:

My final distribution is 47MB in 840 files. Does anyone
have an example that does even better?

> My final distribution is 47MB in 840 files. Does anyone
> have an example that does even better?

I think PyInstaller is supposed to help with this problem:
http://pyinstaller.hpcf.upr.edu/
But I have not used it.

Cheers,
Alan Isaac

Hi Alan, PyInstaller looks intriguing, but the traffic on their
mailing list makes me think that it doesn't have enough users (&
therefore developers) yet. I want to stay on the well-traveled-paths
where I can find them.

I think for now I'll use NSIS w/ py2exe to create a single executable
that unpacks to a temporary directory and launches itself when it's
double clicked. I've used this sucessfully in the past. ( something
like this: http://wiki.wxpython.org/index.cgi/SmallApp )

I think what I'm really hoping for is to find a way to include just
the core functionality of matplotlib, without pulling in numpy and
scipy and all the bells and whistles.

Of course, the real solution to my problem is to just start using all
the bells and whistles (I'm happy to see the mathtext module that will
work on systems that don't have TeX!)

-Jim

···

On 6/28/06, Alan G Isaac <aisaac@...310...> wrote:

On Wed, 28 Jun 2006, James Carroll apparently wrote:

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Understood. But do not overlook that PyInstaller is really
the current life of Gordon McMillan's Python Installer,
so it really is not a new kid on the block.

Cheers,
Alan Isaac

···

On Thu, 29 Jun 2006, James Carroll wrote:

PyInstaller looks intriguing, but the traffic on their
mailing list makes me think that it doesn't have enough
users (& therefore developers) yet. I want to stay on the
well-traveled-paths where I can find them.

Understood. But do not overlook that PyInstaller is really
the current life of Gordon McMillan's Python Installer,
so it really is not a new kid on the block.

I gave PyInstaller a try, and it seemed to be smart and easy at first, and
created a single exe that was just 8MB. The problem is that
when I run the exe, It gives me the following errors before it
crashes:

- Fatal Error: MSVCR71.DLL!
- Fatal Error: colud not be extracted.
- Fatal Error: Error loading Python DLL
- a message box pointing to python24.dll in a temp dir.
- Fatal Error:
- "Please tell microsoft about this problem." [Don't send]

moving msvcr71.dll and python24.dll to the same directory
didn't change anything.

I'll put some more time into trying it, but my first impression isn't good.

Meanwhile, I've removed numarray entirely from the project, and am using
matplotlib.rcParams['numerix'] = 'numpy'

and py2exe + nsis is working pretty well. I have a working single
executable that is 12MB, but it takes about 18 seconds to decompress &
run. If I turn off the
NSIS lzw compression, then it it is a 46MB executable, and runs in about 12
seconds.

I might be trying to create my own C++ wxWidgets top level application
and embed wxPython & matplot lib in that. (has anyone ever had luck
doing this?)

Thanks,
-Jim

http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/ticket/36

hth,
Alan Isaac

···

On Fri, 30 Jun 2006, James Carroll apparently wrote:

I gave PyInstaller a try, and it seemed to be smart and easy at first, and
created a single exe that was just 8MB. The problem is that
when I run the exe, It gives me the following errors before it
crashes:
- Fatal Error: MSVCR71.DLL!
- Fatal Error: colud not be extracted.