Hi Kim,
On 15/03/2010 10:57, Kim Hansen wrote:
Hi group,
I have previously had success with py2exe and matplotlib, using a
specialized setup.py like the attached one (which is adapted from
http://www.py2exe.org/index.cgi/MatPlotLib).
However, now I have tried to go a step further and integrate some
Tkinter controls in the GUI for a prototype, see attached alphabeta.py
If I do a python setup.exe py2exe with this setup file on the attached
Tkinter/matplotlib and alphabeta.exe is successfully created.
However, it does not run for everyone else:
Myself: Works like a charm
A user with a python environment who make py2exes himself: Crashes on
startup with the attached error log
A user with just a Python environment: Works!
A user with no Python environment: Crashes on startup with the same log.
The log does not give me any good ideas as to how I could modify
setup.py to get it working.
Any good ideas?
Changing the line 560 in mathtext.py from:
font = FT2Font(basename)
to:
font = FT2Font(str(basename))
Fixed it for me, I don't know what FT2Font does and why this matters -
hopefully someone else can expand on this.
Attached your setup.py a bit simplified as you are using matplotlib 0.99.
Werner
'''
Created on 25/01/2010
@author: kha
'''
from distutils.core import setup
import py2exe
import shutil
# We need to import the glob module to search for all files.
import glob
# Remove the build and dist folder, old stuff in there is bitting me once to often:)
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)
# 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.
# We also need to include include various numerix libraries that the other functions call.
opts = {
'py2exe': { "includes" : [],
"excludes": ['_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
'_fltkagg', '_gtk', '_gtkcairo', ],
"dll_excludes": ['libgdk-win32-2.0-0.dll',
'libgobject-2.0-0.dll'],
}
}
# matplotlib data
# use mpl's get_py2exe_datafiles()
import matplotlib as mpl
data_files = mpl.get_py2exe_datafiles()
# for console program use 'console = [{"script" : "scriptname.py"}]
setup(windows=[{"script" : "alphabeta.py"}], options=opts, data_files=data_files)
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users