我之所以问这个问题,是因为我不能解决Python/Django
个问题中的一个(实际上在纯Python中是可以的),这会导致RuntimeError: tcl_asyncdelete async handler deleted by the wrong thread
个问题.这在某种程度上与我在Django中渲染matplotlib
个情节的方式有关.我的做法是:
...
import matplotlib.pyplot as plt
...
fig = plt.figure()
...
plt.close()
我极大地简化了我的代码.但问题是-即使我只有一行代码:
fig = plt.figure()
我看到这个RuntimeError正在发生.如果我知道在Python/Django中关闭/清理/销毁情节的正确方法,我希望我能解决这个问题.