Hi, this is a follow-up to my original posting. It turns out that the problem with TkAgg in 'matplotlib' isn't really a sage-specific issue. It is more a problem with the 'matplotlib' installation scripts.
I tried a clean install of 'matplotlib' within a clean, stand-alone Python 2.6 installation. I did this completely outside 'sage'. I had exactly the same issue with TkAgg. The problem is that my system has Tcl and Tk installed in a non-standard place. The python installation scripts for 'matplotlib' couldn't find them, and looked in a hard- coded location as a last act of desperation. I went into one of the setup python scripts for 'matplotlib' and changed the two lines which had hard-coded locations for Tcl and Tk, respectively. Once I did that, TkAgg built cleanly and my 'matplotlib' build/install went fine. I think the same thing would probably work inside sage if one is willing to do some hand editing. In my opinion, the problem is the inflexible installation process for 'matplotlib'. Couldn't the python setup scripts be given at least one additional option that would allow the user to specify the locations of Tcl and Tk? T. Davis On Dec 9, 8:10 am, TDavis <cistim...@gmail.com> wrote: > I have set TkAgg as the matplotlib backend in my matplotlibrc resource > file. I continue to have errors when I try to 'import pylab'. To > make certain it was not a Tkinter issue, I tested Tkinter and re- > installed matplotlib via "./sage -f matplotlib-0.99.1.p2" > > I'm running SLED 10.2 and built sage with gcc 4.2.3. The error log > follows. > > Thanks in advance. > > T. Davis > > local/sage-4.2.1> ./sage > ---------------------------------------------------------------------- > | Sage Version 4.2.1, Release Date: 2009-11-14 | > | Type notebook() for the GUI, and license() for information. | > ---------------------------------------------------------------------- > sage: import pylab > --------------------------------------------------------------------------- > ImportError Traceback (most recent call > last) > > /home/rds625/a289432/.sage/temp/rds625/10783/ > _home_rds625_a289432__sage_init_sage_0.py in <module>() > > local/sage-4.2.1/local/lib/python2.6/site-packages/pylab.py in <module> > () > ----> 1 > 2 > 3 from matplotlib.pylab import * > 4 import matplotlib.pylab > 5 __doc__ = matplotlib.pylab.__doc__ > > local/sage-4.2.1/local/lib/python2.6/site-packages/matplotlib/pylab.py > in <module>() > 245 from numpy.linalg import * > 246 > --> 247 from matplotlib.pyplot import * > 248 > 249 # provide the recommended module abbrevs in the pylab > namespace > > local/sage-4.2.1/local/lib/python2.6/site-packages/matplotlib/ > pyplot.py in <module>() > 76 > 77 from matplotlib.backends import pylab_setup > ---> 78 new_figure_manager, draw_if_interactive, show = pylab_setup() > 79 > 80 > > local/sage-4.2.1/local/lib/python2.6/site-packages/matplotlib/backends/ > __init__.pyc in pylab_setup() > 23 backend_name = 'matplotlib.backends. > %s'%backend_name.lower() > 24 backend_mod = __import__(backend_name, > ---> 25 globals(),locals(), > [backend_name]) > 26 > 27 # Things we pull in from all backends > > local/sage-4.2.1/local/lib/python2.6/site-packages/matplotlib/backends/ > backend_tkagg.py in <module>() > 6 > 7 import Tkinter as Tk, FileDialog > ----> 8 import tkagg # Paint image to Tk photo blitter > extension > 9 from backend_agg import FigureCanvasAgg > 10 > > local/lib/python2.6/site-packages/matplotlib/backends/tkagg.py in > <module>() > ----> 1 > 2 > 3 import _tkagg > 4 import Tkinter as Tk > 5 > 6 def blit(photoimage, aggimage, bbox=None, colormode=1): > 7 tk = photoimage.tk > > ImportError: No module named _tkagg -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org