找不到名为._color _data

时间:2019-03-01 10:31:04

标签: python matplotlib anaconda

我对编码非常陌生。即使我已经通过conda安装了matplotlib。当我尝试导入matplotlib时,它将引发错误。随函附上我得到的错误文件

IPython 7.3.0 -- An enhanced Interactive Python.

注意:设置Matplotlib后端时出现以下错误

Traceback (most recent call last):
  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\spyder_kernels\console\kernel.py", line 475, in _set_mpl_backend
    get_ipython().run_line_magic(magic, backend)
  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\IPython\core\interactiveshell.py", line 2307, in run_line_magic
    result = fn(*args, **kwargs)
  File "<C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\decorator.py:decorator-gen-109>", line 2, in matplotlib
  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\IPython\core\magic.py", line 187, in <lambda>
    call = lambda f, *a, **k: f(*a, **k)
  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\IPython\core\magics\pylab.py", line 99, in matplotlib
    gui, backend = self.shell.enable_matplotlib(args.gui)
  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\IPython\core\interactiveshell.py", line 3379, in enable_matplotlib
    pt.activate_matplotlib(backend)
  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\IPython\core\pylabtools.py", line 306, in activate_matplotlib
    matplotlib.interactive(True)
AttributeError: module 'matplotlib' has no attribute 'interactive'

runfile('C:/Users/user/Anaconda3/envs/tf_gpu/lib/site-packages/matplotlib/colors.py', wdir='C:/Users/user/Anaconda3/envs/tf_gpu/lib/site-packages/matplotlib')
Traceback (most recent call last):

  File "<ipython-input-1-98af3f8b6fe8>", line 1, in <module>
    runfile('C:/Users/user/Anaconda3/envs/tf_gpu/lib/site-packages/matplotlib/colors.py', wdir='C:/Users/user/Anaconda3/envs/tf_gpu/lib/site-packages/matplotlib')

  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
    execfile(filename, namespace)

  File "C:\Users\user\Anaconda3\envs\tf_gpu\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/user/Anaconda3/envs/tf_gpu/lib/site-packages/matplotlib/colors.py", line 69, in <module>
    from _color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, XKCD_COLORS

ModuleNotFoundError: No module named '_color_data'

0 个答案:

没有答案