plt 报错像是下面这样子

File "C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\pyplot.py", line 191, in _get_required_interactive_framework
return backend_mod.FigureCanvas.required_interactive_framework
AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?

 

网上搜了几个方法没有用,我就直接点开报错的文件

C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\pyplot.py

把所有的FigureCanvas,改成FigureCanvasAgg,就能跑了。

报错的信息就是在说,跟着报错信息走。 AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?