import matplotlib.pyplot as plt
输出
ImportError Traceback (most recent call last)
<ipython-input-7-a0d2faabd9e9> in <module>
----> 1 import matplotlib.pyplot as plt
~\AppData\Roaming\Python\Python38\site-packages\matplotlib\__init__.py in <module>
172
173
--> 174 _check_versions()
175
176
~\AppData\Roaming\Python\Python38\site-packages\matplotlib\__init__.py in _check_versions()
157 # Quickfix to ensure Microsoft Visual C++ redistributable
158 # DLLs are loaded before importing kiwisolver
--> 159 from . import ft2font
160
161 for modname, minver in [
ImportError: cannot import name 'ft2font' from partially initialized module 'matplotlib' (most likely due to a circular import) (C:\Users\p****\AppData\Roaming\Python\Python38\site-packages\matplotlib\__init__.py)
答案 0 :(得分:0)
当您在Windows计算机上时,可能存在重复项。 通过点击here.
进行导航这可能是有关matplotlib的问题。 强制通过pip重新安装将解决此问题。
pip install matplotlib --force-reinstall
如果您在Anaconda上徘徊。以管理员身份启动Anaconda,
conda install freetype --force-reinstall
这为我解决了同样的问题。