问题:
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博
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)