Matplotlib – Tcl_AsyncDelete: async handler deleted by the wrong thread?

By default matplotlib uses TK gui toolkit, when you’re rendering an image without using the toolkit (i.e. into a file or a string), matplotlib still instantiates a window that doesn’t get displayed, causing all kinds of problems. In order to avoid that, you should use an Agg backend. It can be activated like so —

import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot

For more information please refer to matplotlib documentation — http://matplotlib.org/faq/howto_faq.html#matplotlib-in-a-web-application-server

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)