Hi,

I have a library which uses matplotlib to produce some plots. This library is 
called by a thread. However, python crashes with this error when it tries to 
plot something:

Tk_MacOSXSetupTkNotifier: first [load] of TkAqua has to occur in the main 
thread!

If I do as it says and call "window = Tkinter.Tk()" in the main thread before 
spawning the thread which calls the plotting routines, it works well until the 
program shuts down. When shutting down, I get a series of these messages (8 of 
them, to be precise):

Exception RuntimeError: RuntimeError('main thread is not in main loop',) in 
<bound method PhotoImage.__del__ of <Tkinter.PhotoImage instance at 0x90fe260>> 
ignored

Googling reveals to me that this is a problem with Tk: it doesn't like 
threading. I tried to force matplotlib to use a different backend with this 
command:
matplotlib.rcParams['backend'] = something_else
but it still crashes with the first error.

Has anyone encountered this problem before? How did you overcome it?

Cheers,
Oliver
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to