在安装最新版本的matplotlib之后,我注意到从matplotlib导入plt时,我的所有程序均正常退出,没有错误或通知。
幸运的是,我可以通过以下方式解决此问题:
import matplotlib
matplotlib.use("TkAgg")
虽然我可以阅读使用的功能,但它不明白为什么它可以解决此错误。 matplotlib的背景会发生什么?
相关:
matplotlib crashes in plt.show() on macOS with TkAgg backend