
在flask项目运行的过程中使用matplotlib画图报错并出现如下错误,错误主要为:
Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘NSWindow drag regions should only be invalidated on the Main Thread!’
解决方法:
设置matplotlib在后台运行,不显示前台GUI
import matplotlib.pyplot as plt
plt.switch_backend('agg')
最后
以上就是奋斗水杯最近收集整理的关于m1 Mac matplotlib 后台画图报错 NSInternalInconsistencyException的全部内容,更多相关m1内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复