scikit-learn1.1.2 问题1:AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘. Did

问题描述

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

原因分析

matplotlib 的 backend的默认渲染器是agg,agg是一个没有图形显示界面的终端

问题解决

文件 - 设置 - Python Scientific - 取消勾选
scikit-learn1.1.2 问题1:AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘. Did_第1张图片
或者使用如下三行

import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt

你可能感兴趣的:(#,scikit-learn,scikit-learn,python,matplotlib)