Hi all,
I have a application using a wxPython gui which has matplotlib figure, axes etc… The code works fine and the display of mathtext works fine when run in python.
When I compile it and try to display any text it doesn’t render the text at all (this can be anything from a simple letter to a more complex equation).
I get an output error:
myDir\dist\library.zip\matplotlib\mathtext.py:722: MathTextWarning: Unrecognized symbol ‘y’. Substituting with a dummy symbol.
I added the the include “matplotlib.mathtext” as before I got an error that it didn’t know what mathtext was.
Any ideas? I’ve looked on line at http://www.py2exe.org/index.cgi/MatPlotLib, and tried all they suggest but no luck so far.
Thanks for any ideas.
Cheers
my py2exe compile.py file is:
from distutils.core import setup
import py2exe
from distutils.core import setup
We need to import the glob module to search for all files.
import glob
import matplotlib
opts = {
‘py2exe’: { “includes” : [“matplotlib.backends.backend_wxagg”,
“matplotlib.figure”,“pylab”, “numpy”, “matplotlib.numerix.fft”,
“matplotlib.numerix.linear_algebra”, “matplotlib.numerix.random_array”,
“matplotlib.mathtext” ],
‘dll_excludes’: [‘libgdk-win32-2.0-0.dll’,
‘libgobject-2.0-0.dll’]
}
}
Looked online and tried this next line - but it doesn’t compile.
#data_files=[matplotlib.get_py2exe_datafiles()]
Save matplotlib-data to mpl-data ( It is located in the matplotlib\mpl-data
folder and the compiled programs will look for it in \mpl-data
note: using matplotlib.get_mpldata_info
data_files = [(r’mpl-data’, glob.glob(r’C:\Python25\Lib\site-packages\matplotlib\mpl-data*.’)),
# Because matplotlibrc does not have an extension, glob does not find it (at least I think that’s why)
# So add it manually here:
(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” : “main.py”}], options=opts, data_files=data_files)