469,909 Members | 1,752 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

py2exe python executable for matplotlib

Hi all,

I have recently started using Python and I am trying to make a GUI out of Tkinter. I am using matplotlib for the graphic purposes. I have to make a exe file from this code. I use py2exe for this purpose but every time I try to make this exe using a setup file I get these errors. Final.py is my python code.

Traceback (most recent call last):
File "Final.py", line 5, in <module>
File "pylab.pyc", line 1, in <module>
File "matplotlib\pylab.pyc", line 204, in <module>
File "matplotlib\mpl.pyc", line 10, in <module>
File "matplotlib\figure.pyc", line 33, in <module>
File "matplotlib\projections\__init__.pyc", line 1, in <module>
File "matplotlib\projections\geo.pyc", line 4, in <module>
File "matplotlib\numerix\__init__.pyc", line 166, in <module>
ImportError: No module named ma

I checked out 'ma' which is actually a import line in geo.py which says:
from matplotlib.numerix import npyma as ma

I guess there is a problem with importing these files. This is my setup file:


from distutils.core import setup
import sys
import os
import glob
import py2exe
import matplotlib
import numpy


opts = {
'py2exe': { "includes" : [ "matplotlib.backends", "matplotlib.backends.backend_qt4agg",
"matplotlib.figure","pylab", "numpy", "matplotlib.numerix.fft",
"matplotlib.numerix.linear_algebra", "matplotlib.numerix.random_array",
"matplotlib.backends.backend_tkagg", "matplotlib.projections" , ],
'excludes': ['_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
'_fltkagg', '_gtk', '_gtkcairo', ],
'dll_excludes': ['libgdk-win32-2.0-0.dll',
'libgobject-2.0-0.dll']
}

}
data_files = [(r'mpl-data', glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\*.*')),
(r'mpl-data', [r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\matplotlibrc']),
(r'mpl-data\images',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\images\*.*')),
(r'mpl-data\fonts',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\fonts\*.*'))]
setup(windows=[{"script" : "Final.py"}], options=opts, data_files=data_files)



Can someone please help me with this.

Thanks,
Aug 4 '08 #1
0 4079

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by Thomas Heller | last post: by
2 posts views Thread by scott | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
4 posts views Thread by bwaha | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
1 post views Thread by Jimmy Retzlaff | last post: by
reply views Thread by Larry Bates | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.