天佑吾身 发表于 2016-11-24 19:37:36

matplotlib导入出现错误,求帮忙

本帖最后由 天佑吾身 于 2016-11-24 19:38 编辑

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

numpy和matplotlib导入正常,matplotlib.pyplot导入时候出现错误:

Traceback (most recent call last):

File "<ipython-input-1-33b161d8c759>", line 3, in <module>
    import matplotlib.pyplot as plt

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
    import matplotlib.colorbar

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\colorbar.py", line 34, in <module>
    import matplotlib.collections as collections

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\collections.py", line 27, in <module>
    import matplotlib.backend_bases as backend_bases

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\backend_bases.py", line 62, in <module>
    import matplotlib.textpath as textpath

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\textpath.py", line 15, in <module>
    import matplotlib.font_manager as font_manager

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1421, in <module>
    _rebuild()

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1406, in _rebuild
    fontManager = FontManager()

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1044, in __init__
    self.ttffiles = findSystemFonts(paths) + findSystemFonts()

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 313, in findSystemFonts
    for f in win32InstalledFonts(fontdir):

File "C:\Program Files\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 231, in win32InstalledFonts
    direc = os.path.abspath(direc).lower()

File "C:\Program Files\Anaconda3\lib\ntpath.py", line 535, in abspath
    path = _getfullpathname(path)

ValueError: _getfullpathname: embedded null character

请问这如何是好。

小古比鱼 发表于 2020-12-16 21:10:00

参考:http://blog.sina.com.cn/s/blog_6681525f0102x2t3.html
页: [1]
查看完整版本: matplotlib导入出现错误,求帮忙