AttributeError: module ‘backend_interagg’ has no attribute ‘Figurecanvas‘. Did you mean: ‘figure...
问题原因:Matplotlib的版本过高或者与特定的后端不兼容。两个解决方法...
·
报错如下:

AttributeError: module 'backend_interagg’ has no attribute 'Figurecanvas'. Did you mean: 'figurecanvasAgg'?
(一开始看到,以为很神奇的报错,一般自带的库不会有什么问题)
问题原因:
Matplotlib的版本过高或者与特定的后端不兼容
方法一:降低matplotlib版本
在anaconda prompt或者cmd输入如下命令
pip uninstall matplotlib
pip install matplolib==3.5.0
方法二:配置后端
在代码中修改
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。
更多推荐
所有评论(0)