我是靠谱客的博主 欢喜小笼包,这篇文章主要介绍解决Matplotlib 报错问题 RuntimeError: main thread is not in main loop,现在分享给大家,希望可以做个参考。
Matplotlib的默认backend是TkAgg,如果改为agg就不会报错,具体原因还不知道。具体做法就是在使用Matplotlib的文件头部增加:
import matplotlib.pyplot as plt
plt.switch_backend('agg')
最后
以上就是欢喜小笼包最近收集整理的关于解决Matplotlib 报错问题 RuntimeError: main thread is not in main loop的全部内容,更多相关解决Matplotlib内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复