Bootstrap

pycharm报错AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘. Did you mean: ‘F

报错提示如下:

AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?

这个错误通常是由于matplotlib后端设置不正确或与运行环境不兼容引起的。为了解决这个问题,我们可以尝试以下方法:

方法1:设置matplotlib后端为:交互式后端/Agg后端

import matplotlib
matplotlib.use('TkAgg')  # 设置为交互式后端
import matplotlib
matplotlib.use('Agg')  # 或者使用 'Agg' 后端

方法2:取消 Show plots in tool window

方法2:升级matplotlib

pip install --upgrade matplotlib

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;