MPL using Python2.6.1 on Windows


This weekend I decided to try and build mpl for windows using python
2.6.1. I was able to build numpy and mpl and I thought things were
great. However, when I tried to run a script with a show() function,
nothing would happen. Looking into this, I discovered that mpl didn't
recognize Tkinter during it's building process. I checked the code and found that python 2.6 wast excluded in the
windows section, even though Tkinter at least imports using python2.6.
I also noticed that there appears to be a hold over to a previous
version of mpl by including references to python 2.2, even though the
TCL/TK headers and libs for TCL/TK 8.3 aren't included in win32_static
version anymore. I decided to build TCL/TK 8.5 (which is what python
2.6 ships with) and dumped the appropriate libs in the lib directory
of win32_static and the header files into include/tcl85 directory. I
then changed references from python 2.2 to use python 2.6 (including
using TCL/TK 8.5 instead of 8.3), rebuilt mpl, and ran it. This time
the show window opens, however as the figure is being drawn an error
occurs and the figure window remains blank. Below is the traceback:

Exception in Tkinter callback
Traceback (most recent call last):
  File "D:\Python26\lib\lib-tk\", line 1410, in __call__
    return self.func(*args)
  File "D:\Python26\lib\site-packages\matplotlib\backends\",
line 212, in resize
  File "D:\Python26\lib\site-packages\matplotlib\backends\",
line 216, in draw
    tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
  File "D:\Python26\lib\site-packages\matplotlib\backends\",
line 19, in blit"PyAggImagePhoto", photoimage, id(aggimage), colormode,

This is as far as I've been able to go (so far) in tracking down the
issue. I'll admit that I haven't looked much farther due to time
constraints, so if anyone else has suggestions as to where to go next,
I'm all ears. I'm not sure who the windows guru is for mpl, but if I
(we) can figure this problem out, I'll work with them in getting mpl
ready for 2.6 on windows.



Patrick Marsh
Graduate Research Assistant
School of Meteorology
University of Oklahoma