gpt4 book ai didi

python - 导入错误:无法导入名称 '_path' matplotlib

转载 作者:太空狗 更新时间:2023-10-30 00:04:56 24 4
gpt4 key购买 nike

当通过 import matplotlib.pyplot as plt 导入 matplotlib 时,出现以下错误:

Traceback (most recent call last):   File "mode.py", line 1, in <module>
import matplotlib.pyplot as plt File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\pyplot.py", line 32, in <module>
import matplotlib.colorbar File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\colorbar.py", line 32, in <module>
import matplotlib.artist as martist File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\artist.py", line 16, in <module>
from .path import Path File "C:\Users\yuhan\AppData\Roaming\Python\Python36\site-packages\matplotlib\path.py", line 25, in <module>
from . import _path, rcParams ImportError: cannot import name '_path'

我尝试重新安装整个 matplotlib 库,尝试重新安装 Python 3.6 等。我真的不知道出了什么问题,因为我没有备份。

最佳答案

py -m pip uninstall matplotlib

然后:

py -m pip install matplotlib

也为我解决了那个错误。

然后我遇到了找不到kiwisolver的问题,也是这样做的卸载,安装 kiwisolver,现在:import matplotlib.pyplot as plt 有效。

关于python - 导入错误:无法导入名称 '_path' matplotlib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49013901/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com