两个月前,我已经安装了anaconda,并且正在使用Jupyter实验室。直到几天前一切正常,我发现了此错误
无法导入名称“ _path”
当我尝试运行该行时:%pylab inline 直到几天前,这件事还没有给我带来错误。
您知道为什么以及如何解决此问题吗?
完全错误是:
ImportError Traceback (most recent call last)
<ipython-input-1-a6e0d37a4680> in <module>
----> 1 get_ipython().run_line_magic('pylab', 'inline')
~\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2305 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2306 with self.builtin_trap:
-> 2307 result = fn(*args, **kwargs)
2308 return result
2309
<C:\Users\Alberto\Anaconda3\lib\site-packages\decorator.py:decorator-gen-110> in pylab(self, line)
~\Anaconda3\lib\site-packages\IPython\core\magic.py in <lambda>(f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):
~\Anaconda3\lib\site-packages\IPython\core\magics\pylab.py in pylab(self, line)
153 import_all = not args.no_import_all
154
--> 155 gui, backend, clobbered = self.shell.enable_pylab(args.gui, import_all=import_all)
156 self._show_matplotlib_backend(args.gui, backend)
157 print ("Populating the interactive namespace from numpy and matplotlib")
~\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in enable_pylab(self, gui, import_all, welcome_message)
3416 from IPython.core.pylabtools import import_pylab
3417
-> 3418 gui, backend = self.enable_matplotlib(gui)
3419
3420 # We want to prevent the loading of pylab to pollute the user's
~\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in enable_matplotlib(self, gui)
3377 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
3378
-> 3379 pt.activate_matplotlib(backend)
3380 pt.configure_inline_support(self, backend)
3381
~\Anaconda3\lib\site-packages\IPython\core\pylabtools.py in activate_matplotlib(backend)
311 matplotlib.rcParams['backend'] = backend
312
--> 313 import matplotlib.pyplot
314 matplotlib.pyplot.switch_backend(backend)
315
~\Anaconda3\lib\site-packages\matplotlib\pyplot.py in <module>
29 from cycler import cycler
30 import matplotlib
---> 31 import matplotlib.colorbar
32 from matplotlib import style
33 from matplotlib import _pylab_helpers, interactive
~\Anaconda3\lib\site-packages\matplotlib\colorbar.py in <module>
30
31 import matplotlib as mpl
---> 32 import matplotlib.artist as martist
33 import matplotlib.cbook as cbook
34 import matplotlib.collections as collections
~\Anaconda3\lib\site-packages\matplotlib\artist.py in <module>
14 import matplotlib
15 from . import cbook, docstring, rcParams
---> 16 from .path import Path
17 from .transforms import (Bbox, IdentityTransform, Transform, TransformedBbox,
18 TransformedPatchPath, TransformedPath)
~\Anaconda3\lib\site-packages\matplotlib\path.py in <module>
19 import numpy as np
20
---> 21 from . import _path, rcParams
22 from .cbook import (_to_unmasked_float_array, simple_linear_interpolation,
23 maxdict)
ImportError: cannot import name '_path'