Isues between Matplotlib TkAgg and wxPython

189 views
Skip to first unread message

mbre...@gmail.com

unread,
Jun 24, 2022, 4:14:07 AM6/24/22
to wxPython-users
Dear all

I have project using wxPython with Matplotlib. They played very well together until recently, after some software upgrade of my Linux machine. I did not touch my code when the problem started to appear.

Then I run my code, I get this error: "Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'wx' is currently running"

Digging deeper I found that the error happens at this call (when the frame containing the Matplotlib panel is being set up):

   self.figure = plt.figure()

Does anyone have an idea what is happening here or what I should be looking for?

Matthias

mbre...@gmail.com

unread,
Jun 26, 2022, 1:01:56 PM6/26/22
to wxPython-users
It turned out that some external modules imported to my code initialized matplotlib with the TkAgg backend, which was causing the trouble. I was able to fix the issue by modifying the external modules to avoid this.
Reply all
Reply to author
Forward
0 new messages