无法导入matplotlib.pyplot'Nonetype'对象不可迭代

时间:2018-10-11 15:46:32

标签: python python-3.x matplotlib anaconda

我只是尝试在Windows上使用Anaconda的最新版本导入matplotlib.pyplot,导入matplotlib效果很好,但是当我尝试导入matplotlib.pyplot时,显示以下错误:


import matplotlib.pyplot as plt
Traceback (most recent call last):

  File "<ipython-input-8-a0d2faabd9e9>", line 1, in <module>
    import matplotlib.pyplot as plt

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 32, in <module>
    import matplotlib.colorbar

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
    import matplotlib.contour as contour

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\contour.py", line 18, in <module>
    import matplotlib.font_manager as font_manager

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1363, in <module>
    _rebuild()

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1344, in _rebuild
    fontManager = FontManager()

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 978, in __init__
    ttffiles = findSystemFonts(paths) + findSystemFonts()

  File "C:\Users\AbanoubMamdouh\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 264, in findSystemFonts
    fontfiles.update(win32InstalledFonts(fontext=fontext))

TypeError: 'NoneType' object is not iterable

我在matplotlib.pyplot上查找了类似的错误,但是没有一个是'NoneType'对象。 更新:当我尝试运行命令时出现了相同的错误:

import seaborn as sns

有人知道如何解决此问题吗?

干杯!

0 个答案:

没有答案