freezing matplotlib

Has anyone tried freezing matplotlib embedded in a wx app (using py2ece, cx_freeze or pyinstaller)? The setup.py in the FAQ seems to be outdated. I want to freeze the embedding_in_wx.py in the examples. Do you have any suggestions or cookbook steps that I can follow?

it looks there were no answer to your question!

I tried too the FAQ
http://matplotlib.sourceforge.net/faq.html#PY2EXE

and it does not work at least with my enthough installation directories seems
to be very different from the one suggested.

I also tried MatPlotLib - py2exe.org without success

I tried the simpelst thing

from pylab import *
plot([1,2,3])
show()

no chance!
I don't know if someone could help, is there a better backend for freezing,
maybe wxpython?

Someone already succeded with a recent matplotlib ?
I'm using 0.87.3 (on windows)

···

Le lundi 25 décembre 2006 16:00, Allan Noriel Estrella a écrit :

Has anyone tried freezing matplotlib embedded in a wx app (using py2ece,
cx_freeze or pyinstaller)? The setup.py in the FAQ seems to be outdated. I
want to freeze the embedding_in_wx.py in the examples. Do you have any
suggestions or cookbook steps that I can follow?

Hi,

Emmanuel Favre-Nicolin wrote:

  

Has anyone tried freezing matplotlib embedded in a wx app (using py2ece,
cx_freeze or pyinstaller)? The setup.py in the FAQ seems to be outdated. I
want to freeze the embedding_in_wx.py in the examples. Do you have any
suggestions or cookbook steps that I can follow?
    
it looks there were no answer to your question!

I tried too the FAQ http://matplotlib.sourceforge.net/faq.html#PY2EXE

and it does not work at least with my enthough installation directories seems to be very different from the one suggested.

I also tried MatPlotLib - py2exe.org without success

I tried the simpelst thing

from pylab import *
plot([1,2,3])
show()

no chance!
I don't know if someone could help, is there a better backend for freezing, maybe wxpython?

Someone already succeded with a recent matplotlib ?
I'm using 0.87.3 (on windows)
  

I am way behind on matplotlib version (still on 0.82) but here is an example setup.py to freeze the matplotlib sample wxcursor_demo.py (included just in case it changed).

I just have no time yet to upgrade to a newer version, especially as I want to upgrade to wxPython 2.8 at the same time.

Here a fews things I recall from my tests with 0.87.3:
- you need to use the unicode build of wxPython (also this might have or will change).
- matplotlib data folder handling (see in setup.py commented line in data_files section)
- numpy (just tried it building against 87.3 but get errors related to numpy, one probably has to force more inclusions)

Hope this helps
Werner

setup.py (3.85 KB)

wxcursor_demo.py (3.83 KB)

···

Le lundi 25 décembre 2006 16:00, Allan Noriel Estrella a écrit :

I tried directly the setup.py, it does not work with wxcursor_demo.py

My first try was modifying the following in the setup.py :

#mpldata = glob.glob(r'C:\Python24\share\matplotlib\*')
mpldata=[]
for di in allsubdirs(r'C:\Python24\Lib\site-packages\matplotlib'):
ti=di+'*.py*'
mpldata=mpldata+glob.glob(ti)
#mpldata.append(r'C:\Python24\share\matplotlib\.matplotlibrc')
mpldata.append (r'C:
\Python24\Lib\site-packages\matplotlib\mpl-data\matplotlibrc')

The exe fails at importation line :
from matplotlib.numerix import arange, sin, pi

Here is the error log :
Traceback (most recent call last):
File "wxcursor_demo.py", line 7, in ?
File "zipextimporter.pyo", line 82, in load_module
File "matplotlib\__init__.pyo", line 720, in ?
File "matplotlib\__init__.pyo", line 273, in wrapper
File "matplotlib\__init__.pyo", line 360, in _get_data_path
RuntimeError: Could not find the matplotlib data files

So I guess I did quite wrong! I have too look further...

BTW, I'm using enthon-python2.4-1.0.0.exe