OSX Leopard Install TkAgg Problem and Solution

I don't know if this was peculiar to my set-up but others might find this useful.

I recently installed Matplotlib 0.90.1 from source on a G4 Powerbook and a dual G5 PowerMac, both running OSX 10.5.1. Installation proceeded smoothly and once the by now well documented python path issue had been fixed, Matplotlib imported and ran fine with the Agg back-end.

However, attempting to use TkAgg led to allocation error somewhere deep in Tcl. I finally traced this to the fact that I had a legacy version of the Tcl and Tk frameworks in /Library/Frameworks. These were being used in preference to the Leopard installed frameworks in /System//Library/Frameworks. Removing the /Library/Frameworks solved these problems.