python matplotlib cannot import name ‘artist‘ from ‘matplotlib‘
问题:cannot import name 'artist' from 'matplotlib'搜索后发现可能是误删了部分文件,需要卸载matplotlib后重新安装,但是无法卸载,会出现下面的问题。Cannot uninstall matplotlib 3.4.3, RECORD file not found.You might be able to recover from this via:
问题:
import matplotlib.pyplot as plt 报错
cannot import name 'artist' from 'matplotlib'
无法从“matplotlib”导入名称“artist”
搜索后发现可能是误删文件导致的,需要卸载matplotlib后重新安装,但是无法卸载,会报错
Cannot uninstall matplotlib 3.4.3, RECORD file not found. You might be able to recover from this via: 'pip install --force-reinstall --no-deps matplotlib==3.4.3'.
无法卸载matplotlib 3.4.3,找不到RECORD文件。您可以通过以下方式恢复:
“pip-install--force-renstall--no deps matplotlib==3.4.3”。
按照要求使用
pip install --force-reinstall --no-deps matplotlib==3.4.3
进行恢复,还是没用。不卸载,直接用
pip install matplotlib
安装也不行,限定安装matplotlib的版本也没用。
解决:
无意中想起来之前遇到过类似的问题,就尝试了一下当时的解决办法,没想到竟然有用
conda install --yes freetype=2.10.4
如果其他方法都没用的话,可以试试这个; )
参考:Jupyter中使用matplotlib画图出现kernel died问题_BuCCiaRaTi B的博客-CSDN博
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)