解决 Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. 问题

大城市里の小女人 提交于 2019-11-28 20:10:13

1, 安装 tk-dev 和 python3-tk

sudo apt-get install tk-dev
sudo apt install python3-tk

2,修改 matplotlibrc 文件
sudo geidt  ~/.../lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc
搜索:#backend      : Agg
替换为:     backend      : TkAgg

3,如果需要,重新安装 matplotlib:
pip uninstall -y matplotlib
pip --no-cache-dir install -U matplotlib

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!