From: Michael H. <mh...@si...> - 2005-08-11 14:51:10
|
Thanks for all the help. I'm packing to head home, so I won't be able to = work on this again for two weeks. Maybe I can put this together and put it in the py2exe Wiki. Michael Huster, Ph. D. Assistant Professor of Science Simpson University 2211 College View Dr. Redding, CA 96003 -----Original Message----- From: Noko Phala [mailto:np...@an...] Sent: Wed 8/10/2005 9:58 PM To: Michael Huster Subject: RE: [Matplotlib-users] Matplotlib + py2exe =3D frustration =20 I feel your pain. After a billion tries, I got a similar scipy+matplotlib app to work with the following (a few scipy-specific modules, like integrate, had to be called from the main script itself:) from distutils.core import setup import py2exe import glob import os #for matplotlib data=3Dglob.glob(r'C:\Python23\share\matplotlib\*') data.append(r'C:\Python23\share\matplotlib\matplotlibrc') options =3D { "py2exe": { "includes": ['scipy','scipy.integrate','matplotlib.*', 'scipy.special.*','scipy.linalg.*','scipy.*',\ ], "packages": ['encodings','matplotlib.numerix.random_array','pytz',\ 'dateutil','numarray' ], =20 } } setup( =20 version =3D "0.1.1", console =3D ["C:\Python23\myscript.py"], data_files =3D [("matplotlibdata",data)],=20 options=3Doptions=20 =20 ) Good luck, Dr Noko Phala Process Research Anglo Research=20 PO Box 106 Crown Mines 2025 Republic of South Africa Tel: +27 (11) 377 4817 e-mail: np...@an...=20 =20 -----Original Message----- From: mat...@li... [mailto:mat...@li...] On Behalf Of Michael Huster Sent: Wednesday, August 10, 2005 6:09 PM To: Mat...@li... Subject: [Matplotlib-users] Matplotlib + py2exe =3D frustration I cross-posted this on py2exe-users w/o getting help yet. Yes, I've read the Wiki - http://starship.python.net/crew/theller/moin.cgi/MatPlotLib and any other pages I could google. I want to package a pylab (aka scipy, aka matplotlib) app. I'm on Win XP. I've been trying for four days. I've boiled it down to this: ----------------------------------------------------- Test.py: import pylab a =3D arange(10) print a ----------------------------------------------------- Setup.py: from distutils.core import setup import py2exe import glob # from py2exe wiki: matplotlib """ These don't work so I commented them out: opts =3D { 'py2exe': { 'excludes': ['_gtkagg', '_tkagg'], 'dll_excludes': ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll'], 'includes': ['matplotlib.numerix.random_array'], } } """ setup( # This doesn't make it work either: data_files =3D [ (r'lib\matplotlibdata', glob.glob(r'c:\python23\share\matplotlib\*')), (r'lib\matplotlibdata', glob.glob(r'c:\Python23\share\matplotlib\.matplotlibrc')), ], version =3D "0.7.0", description =3D "test py2exe & pylab", name =3D "TestPy2exe", author =3D "Michael E Huster", # targets to build console =3D ["test.py"] ) ----------------------------------------------------- I run: Prompt> python setup.py py2exe Prompt> cd dist Prompt> test.exe Traceback (most recent call last): File "test.py", line 1, in ? File "pylab.pyc", line 1, in ? File "matplotlib\__init__.pyc", line 509, in ? File "matplotlib\__init__.pyc", line 245, in wrapper File "matplotlib\__init__.pyc", line 318, in _get_data_path RuntimeError: Could not find the matplotlib data files Prompt> Michael Huster, Ph. D. Assistant Professor of Science Simpson University 2211 College View Dr. Redding, CA 96003 ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |