TKinter : 'module' object has no attribute 'tkinit'

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

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
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

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
  

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

--
Darren S. Dale, Ph.D.
Staff Scientist
Cornell High Energy Synchrotron Source
Cornell University
275 Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853

darren.dale@...143...
office: (607) 255-3819
fax: (607) 255-9001
http://www.chess.cornell.edu

root@~ $ emerge --searchdesc tk-devel
Searching...
[ Results for search key : tk-devel ]
[ Applications found : 0 ]

Evidently, gentoo has no tk-devl packages -- only gtk-devel ... which leads me to believe the problem with the install has to do with the fact that I am not use Gtk.

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
    

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
    
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

fiacre wrote:

root@~ $ emerge --searchdesc tk-devel
Searching...
[ Results for search key : tk-devel ]
[ Applications found : 0 ]

Evidently, gentoo has no tk-devl packages -- only gtk-devel ... which leads me to believe the problem with the install has to do with the fact that I am not use Gtk.

Since gentoo is a source-based distro, there are no *-devel packages, since the headers always get installed with the library itself. Binary distros have the *-devel packages so that only those people who wish to do development (ie. compile) need to install the headers.

Ryan

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Michael Droettboom wrote:

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?

Just as a an FYI, on my Gentoo box here, with matplotlib 0.91.2 installed from Portage, I have: /usr/lib/python2.5/site-packages/matplotlib/backends/_tkagg.so

And I don't have any problems with the TkAgg backend.

Ryan

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Yes, that is very odd. Did we every have a _tkagg python module in
the old days (Todd?). If so, and fiarce is installing over an old
distro, he may be getting into a conflict between a *.so and a *.py
module in the same directory. One thing to try is to the "build" dir
in the src distribution and most importantly site-packages/matplotlib
and try for a clean install. And use ubuntu rather than gentoo <wink>

JDH

···

On Fri, Mar 21, 2008 at 8:21 AM, Michael Droettboom <mdroe@...31...> 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 -->

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