As it happens, the box I was working on totally borked (hardware problem). I've built a CentOS box and am running fine now --- I made a point of installing X, gtk, cairo, tcl, tk and other graphics libs before building python and matplotlib on the box.
So, the problems seems to be related to the way python and/or Tkinter was built. X was not on the box when I built python initially. * shrug * Things work nicely now. Michael Droettboom wrote: > It doesn't look like a faulty X setup, and since you *do* get a > window, it's unlikely it's a Tkinter problem. > > The fishy thing here is that _tkagg should be a C extension, have a > .so file extension and have only the following members --> > > >>> dir(_tkagg) > ['__doc__', '__file__', '__name__', '_pyobj_addr', 'tkinit'] > > tkagg (without the underscore), on the other hand, is a true Python > module, would have a .pyc extension and all of the members you posted. > > So, somehow, tkagg got renamed to _tkagg on your system. I'm not sure > how the build script may have done that. Does removing > > /usr/lib/python2.5/site-packages/matplotlib/backends/_tkagg.pyc > > help? (It's generally safe to remove .pyc files since they are > regenerated by the Python compiler). Do you have a _tkagg.py sitting > in that directory? > > Did you build matplotlib from the source tarball, a Gentoo port (or > whatever they're called), or some other way? > > If you built yourself, (even if the above suggestion worked), could > you try cleanly rebuilding again by: > > 1. deleting the build directory under the source tree > 2. deleting /usr/lib/python2.5/site-packages/matplotlib > 3. "python setup.py install" > > and let us know if that worked? > > Cheers, > Mike > > Darren Dale wrote: >> Do you have the tk-devel packages installed? When you run setup.py, >> there is a report at the beginning which lists all the required and >> optional dependencies, would you post that? >> >> On Friday 21 March 2008 08:52:40 am fiacre wrote: >> >>> I agree -- I don't believe it built correctly either ... >>> >>> Python 2.5.1 (r251:54863, Mar 20 2008, 04:03:41) >>> [GCC 3.4.5 (Gentoo 3.4.5-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2 >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> from matplotlib.backends import _tkagg >>> >>> _tkagg.__file__ >>> >>> '/usr/lib/python2.5/site-packages/matplotlib/backends/_tkagg.pyc' >>> >>> >>> dir(_tkagg) >>> >>> ['AxisMenu', 'Figure', 'FigureCanvasAgg', 'FigureCanvasBase', >>> 'FigureCanvasTkAgg', 'FigureManager', 'FigureManagerBase', >>> 'FigureManagerTkAgg', 'FileDialog', 'Gcf', 'GraphicsContextBase', >>> 'NavigationToolbar', 'NavigationToolbar2', 'NavigationToolbar2TkAgg', >>> 'PIXELS_PER_INCH', 'RendererBase', 'SubplotTool', 'Tk', '__builtins__', >>> '__doc__', '__file__', '__name__', 'asarray', 'backend_version', >>> 'cursord', 'cursors', 'division', 'draw_if_interactive', 'enumerate', >>> 'error_msg_tkpaint', 'is_string_like', 'math', 'matplotlib', >>> 'new_figure_manager', 'os', 'raise_msg_to_str', 'rcParams', 'round', >>> 'show', 'sys', 'tkagg', 'verbose', 'windowing'] >>> >>> >>> >>> I don't see anything obviously wrong though -- I am wondering if my X >>> setup is faulty. >>> >>> Thanks! >>> >>> Michael Droettboom wrote: >>> >>>> It looks like the _tkagg C extension didn't build correctly -- it >>>> really should have a tkinit method. >>>> >>>> Can you please try the following and send me the output (inside the >>>> Python interpreter)... >>>> >>>> >>>>>>> from matplotlib.backends import _tkagg >>>>>>> _tkagg.__file__ >>>>>>> dir(_tkagg) >>>>>>> >>>> Thanks! >>>> >>>> Mike >>>> >>>> fiacre wrote: >>>> >>>>> I'm running Idle via X forwarding to my Windows desktop (running >>>>> Cygwin). >>>>> >>>>> I've installed tcl/tk and python with Tkinter as a backend. >>>>> >>>>> When I call pylab.show(), I always get the error : >>>>> >>> pylab.show() >>>>> >>>>> Exception in Tkinter callback >>>>> Traceback (most recent call last): >>>>> File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__ >>>>> return self.func(*args) >>>>> File >>>>> "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_tkagg.py", >>>>> >>>>> line 151, in resize >>>>> self.show() >>>>> File >>>>> "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_tkagg.py", >>>>> >>>>> line 155, in draw >>>>> tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) >>>>> File >>>>> "/usr/lib/python2.5/site-packages/matplotlib/backends/tkagg.py", line >>>>> 14, in blit >>>>> _tkagg.tkinit(id(tk), 0) >>>>> AttributeError: 'module' object has no attribute 'tkinit' >>>>> >>>>> >>>>> And an empty matplotlib window opens on my desktop. >>>>> >>>>> >>>>> Should I try gtk as a backend??? >>>>> >>>>> TIA >>>>> >>>>> -- Andrew >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> - >>>>> >>>>> This SF.net email is sponsored by: Microsoft >>>>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>>>> _______________________________________________ >>>>> Matplotlib-devel mailing list >>>>> Matplotlib-devel@lists.sourceforge.net >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>>>> >>> ------------------------------------------------------------------------- >>> >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> _______________________________________________ >>> Matplotlib-devel mailing list >>> Matplotlib-devel@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>> >> >> >> >> > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel