[Distutils] MatPlotLib + Py2exe, backend problems ...

Stef Mientki s.mientki at ru.nl
Sat Feb 16 12:19:46 CET 2008


hello,

I'm trying to create a distro with py2exe, including MatPlotLib.
After finally resolving the matplotlib datapath problem,
I bumped into a new problem concerning backends.

I'm using MatPlotLib 0.91.2
I only need the wx-Backend.

In Py2exe I tried to exclude as many backends as possible,
but the excludes seems to have no effect.
      'excludes' : [
         '_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
         '_fltkagg', '_gtk', '_gtkcairo',
         'backend_qt', 'backend_qt4', 'backend_qt4agg',
         'backend_qtagg',
         'backend_cairo', 'backend_cocoaagg',
         'Tkconstants', 'Tkinter', 'tcl',
         "_imagingtk", "PIL._imagingtk", "ImageTk", "PIL.ImageTk", "FixTk"
          ],

The creating of the distro seems to work,
but the distro won't run,
because of some problems with tk-backends, (which I don't need or even 
want).

The problem might be caused by a crashed installation of tk in the past.
And might also be amplified by the fact that I use
   from pylab import *

Now I guess I can effectively remove the unnecessary backends,
by removing the following lines from \backends\__init__.py

interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg',
                  'TkAgg', 'WX', 'WXAgg', 'CocoaAgg']
non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GDK',
                      'Pdf', 'PS', 'SVG', 'Template']

I don't know if this solves the problem (haven't tried it yet),
but I certainly thinks this is not the proper way to go.

Any solution / suggestion would be very welcome (while MatPlotLib is 
quit essential in my distro)

thanks,
Stef Mientki


More information about the Distutils-SIG mailing list