Hello, I’m using matplotlib
0.83.2 and I’m trying to get matplotlib to work
with py2exe. I am getting this error message in the *.exe.log
file:
Traceback
(most recent call last):
File
“SPC.py”, line 6, in ?
File
“Frame1.pyc”, line 10, in ?
File
“Frame2.pyc”, line 9, in ?
File
“matplotlib_init_.pyc”, line 568, in ?
File
“matplotlib_init_.pyc”, line 261, in
wrapper
File
“matplotlib_init_.pyc”, line 376, in _get_data_path
RuntimeError:
Could not find the matplotlib data files
My setup.py is listed
below:
#setup.py
from
distutils.core import setup
import
py2exe
We need to import the
glob module to search for all files.
import
glob
We need to exclude matplotlib backends not being
used by this executable. You may
find
that you need different
excludes to create a working executable with your chosen backend.
opts
= {
‘py2exe’: { ‘excludes’: [’_gtkagg’,
‘_tkagg’],
‘dll_excludes’: [‘libgdk-win32-2.0-0.dll’,
'libgobject-2.0-0.dll']
}
}
Additional data files are required by matplotlib.
Note that the glob.glob routine
doesn’t seem to pick up the .matplotlib
resource file, so I copy that separately.
setup(
data_files = [(‘lib\matplotlibdata’,
glob.glob(r’c:\python24\share\matplotlib*’)),
(‘lib\matplotlibdata’, [‘c:\python24\share\matplotlib\matplotlibrc’])],
name = ‘demo’,
description = ‘MatPlotLib
Demo Program’,
windows = [{“script”:“SPC.py”,
“icon_resources”:[(0x001,
“mag.ico”)]}]
)
there are also lots of
files that are excluded these are:
The following modules appear to be missing
[’_xlrdutils’, ‘cephes’, ‘numerix.ArrayType’, ‘numerix.Complex’, ‘numerix.Float’
, ‘numerix.Float32’, ‘numerix.Float64’, ‘numerix.Int’, ‘numerix.Int16’, 'numerix
.Int32’, ‘numerix.Matrix’,
‘numerix.UInt8’, ‘numerix.absolute’, ‘numerix.add’, ’
numerix.alltrue’,
‘numerix.arange’, ‘numerix.arctan2’, ‘numerix.argmin’, 'numeri
x.argsort’,
‘numerix.array’, ‘numerix.asarray’,
‘numerix.asum’, ‘numerix.ceil’,
‘numerix.clip’, ‘numerix.compress’, ‘numerix.concatenate’,
‘numerix.conjugate’,
‘numerix.convolve’, ‘numerix.cos’, ‘numerix.cumsum’, ‘numerix.diagonal’, 'numeri
x.divide’,
‘numerix.dot’, ‘numerix.equal’,
‘numerix.exp’, ‘numerix.fft.fft’,
'nu
merix.fft.inverse_fft’,
‘numerix.floor’, ‘numerix.greater’,
‘numerix.indices’, ’
numerix.less’, ‘numerix.log’,
‘numerix.log10’, ‘numerix.logical_and’, 'numerix.m
atrixmultiply’,
‘numerix.maximum’, ‘numerix.minimum’,
‘numerix.mlab.amax’, 'nume
rix.mlab.amin’,
‘numerix.mlab.cov’, ‘numerix.mlab.diff’,
‘numerix.mlab.flipud’,
‘numerix.mlab.hanning’, ‘numerix.mlab.rand’, ‘numerix.mlab.std’,
'numerix.mlab.s
vd’,
‘numerix.multiply’, ‘numerix.nonzero’,
‘numerix.nx’, ‘numerix.ones’,
'numer
ix.pi’,
‘numerix.power’, ‘numerix.put’,
‘numerix.ravel’, ‘numerix.repeat’,
'nume
rix.reshape’,
‘numerix.resize’, ‘numerix.searchsorted’,
‘numerix.shape’, 'numeri
x.sin’,
‘numerix.size’, ‘numerix.sometrue’,
‘numerix.sort’, ‘numerix.sqrt’,
'num
erix.take’,
‘numerix.tan’, ‘numerix.transpose’,
‘numerix.where’, ‘numerix.which’
, ‘numerix.zeros’, ‘matplotlib.numerix.absolute’, ‘matplotlib.numerix.equal’,
'm
atplotlib.numerix.sqrt’,
‘numarray.Complex’, ‘numarray.Complex32’, 'numarray.Com
plex64’, ‘numarray.Float’,
‘numarray.Float32’, ‘numarray.Float64’, 'numarray.Int
', ‘numarray.Int16’, ‘numarray.Int32’,
‘numarray.Int8’, ‘numarray.NumArray’, 'nu
marray.UInt16’, ‘numarray.UInt32’, ‘numarray.UInt8’,
‘numarray.asarray’, 'numarr
ay.fromlist’, ‘numarray.shape’, ‘numarray.typecode’, ‘numarray.zeros’]
any ideas how I can fix
this thing so that it can work?
Thanks!
Jeff
···
Jeffrey Thomas Peery
SeaMetrics, Inc.
Mechanical Engineer
JeffPeery@…674…
253.872.0285 (fax)
253.872.0284 (phone)