UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
需要安装GUI库 比如qt5
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ pyqt5
并且在 python 代码里使用GUI库
import matplotlib
matplotlib.use("qt5Agg")
本文指导读者如何在遇到Matplotlib使用警告后,通过安装PyQt5 GUI库并设置matplotlib.use('qt5Agg')来解决图表无法显示的问题,适合Python开发者参考。
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
需要安装GUI库 比如qt5
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ pyqt5
并且在 python 代码里使用GUI库
import matplotlib
matplotlib.use("qt5Agg")

被折叠的 条评论
为什么被折叠?