|
From: Oliver K. <oli...@gm...> - 2013-03-14 01:43:25
|
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 |