调用python生成图片时,爆出错误: NameError: global name ‘plt’ is not defined 解决方法 在代码头部引入os模块即可 import os import matplotlib.pyplot as plt