使用Anaconda IDE导入Matplotlib时出错

时间:2016-06-01 22:03:48

标签: python matplotlib anaconda

我刚刚安装了Anaconda 3,我正在尝试使用Pylab来绘制函数。但是当使用行代码from matplotlib import *时,我得到以下错误,我一直试图解决3天。我已经尝试了conda update -all,或者安装了以前版本的Matplotlib。 这是错误:

runfile('C:/Users/USUARIO/.spyder2-py3/temp.py', wdir='C:/Users/USUARIO/.spyder2-py3')
Traceback (most recent call last):

  File "<ipython-input-1-9b55d1cb87fc>", line 1, in <module>
    runfile('C:/Users/USUARIO/.spyder2-py3/temp.py', wdir='C:/Users/USUARIO/.spyder2-py3')

  File "C:\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 714, in runfile
    execfile(filename, namespace)

  File "C:\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 89, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/USUARIO/.spyder2-py3/temp.py", line 3, in <module>
    from pylab import *

  File "C:\Anaconda3\lib\site-packages\pylab.py", line 1, in <module>
    from matplotlib.pylab import *

  File "C:\Anaconda3\lib\site-packages\matplotlib\pylab.py", line 231, in <module>
    import matplotlib.finance

  File "C:\Anaconda3\lib\site-packages\matplotlib\finance.py", line 27, in <module>
    from matplotlib.collections import LineCollection, PolyCollection

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

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

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

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

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

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

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

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

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

ValueError: _getfullpathname: embedded null character`

有关如何修复它的想法吗?

0 个答案:

没有答案