【无标题】ImportError: cannot import name ‘FigureCanvasAgg‘ from ‘matplotlib.backends.backend_agg‘

同学运行一个求拟合曲线的Python代码时,pycharm出现错误ImportError: cannot import name 'FigureCanvasAgg' from 'matplotlib.backends.backend_agg' 

解决方案:

可能是matplotlib的版本较低,可升级matplotlib的版本至最新版本。双击上三角箭头,

【无标题】ImportError: cannot import name ‘FigureCanvasAgg‘ from ‘matplotlib.backends.backend_agg‘_第1张图片

来到matplotlib的这个页面,勾选Specify version,点击install

【无标题】ImportError: cannot import name ‘FigureCanvasAgg‘ from ‘matplotlib.backends.backend_agg‘_第2张图片 

 

你可能感兴趣的:(Python学习,matplotlib,python,开发语言)