我正在启动 python,我遇到了模块 matplotlib。我在导入matplotlib.pyplot
. 实际上,我知道这是一个非常有名的问题,但是我无法以任何方式解决这个问题。
Python 2.7:无法导入 matplotlib.pyplot
对于上面的链接,这与我的错误不同。
我现在有 EOFError,让我很烦。我尝试了很多东西。比如重新安装matplotlib,conda install matplotlib
不使用pip安装等。我是否必须重新安装anaconda..?
Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1429, in <module>
fontManager = pickle_load(_fmcache)
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 966, in pickle_load
data = pickle.load(fh)
EOFError: Ran out of input
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\colorbar.py", line 36, in <module>
import matplotlib.contour as contour
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\contour.py", line 22, in <module>
import matplotlib.font_manager as font_manager
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1439, in <module>
_rebuild()
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1418, in _rebuild
fontManager = FontManager()
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 1053, in __init__
self.ttffiles = findSystemFonts(paths) + findSystemFonts()
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 325, in findSystemFonts
for f in win32InstalledFonts(fontdir):
File "C:\Users\water\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 241, in win32InstalledFonts
direc = os.path.abspath(direc).lower()
File "C:\Users\water\Anaconda3\lib\ntpath.py", line 535, in abspath
path = _getfullpathname(path)
ValueError: _getfullpathname: embedded null character