我4个月前开始学习Python,几乎一切都很完美,直到我有一个练习,我必须做3d图。 为此,我必须导入mpl_toolkits.mplit3d,但我收到此错误:
ValueError Traceback (most recent call last)
<ipython-input-3-c39f93eee133> in <module>()
----> 1 get_ipython().magic('matplotlib notebook')
2 from pylab import *
3 from mpl_toolkits.mplot3d import Axes3D
4
5 Lp = 200
/usr/local/lib/python3.4/dist-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
2334 magic_name, _, magic_arg_s = arg_s.partition(' ')
2335 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2336 return self.run_line_magic(magic_name, magic_arg_s)
2337
2338 #-------------------------------------------------------------------------
/usr/local/lib/python3.4/dist-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
2255 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2256 with self.builtin_trap:
-> 2257 result = fn(*args,**kwargs)
2258 return result
2259
/usr/local/lib/python3.4/dist-packages/IPython/core/magics/pylab.py in matplotlib(self, line)
/usr/local/lib/python3.4/dist-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):
/usr/local/lib/python3.4/dist-packages/IPython/core/magics/pylab.py in matplotlib(self, line)
98 print("Available matplotlib backends: %s" % backends_list)
99 else:
--> 100 gui, backend = self.shell.enable_matplotlib(args.gui)
101 self._show_matplotlib_backend(args.gui, backend)
102
/usr/local/lib/python3.4/dist-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui)
3130 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
3131
-> 3132 pt.activate_matplotlib(backend)
3133 pt.configure_inline_support(self, backend)
3134
/usr/local/lib/python3.4/dist-packages/IPython/core/pylabtools.py in activate_matplotlib(backend)
270 # the rcParam to update. This needs to be set *before* the module
271 # magic of switch_backend().
--> 272 matplotlib.rcParams['backend'] = backend
273
274 import matplotlib.pyplot
/usr/lib/python3/dist-packages/matplotlib/__init__.py in __setitem__(self, key, val)
808 warnings.warn(self.msg_depr_ignore % (key, alt))
809 return
--> 810 cval = self.validate[key](val)
811 dict.__setitem__(self, key, cval)
812 except KeyError:
/usr/lib/python3/dist-packages/matplotlib/rcsetup.py in validate_backend(s)
144 return s
145 else:
--> 146 return _validate_standard_backends(s)
147
148 validate_qt4 = ValidateInStrings('backend.qt4', ['PyQt4', 'PySide'])
/usr/lib/python3/dist-packages/matplotlib/rcsetup.py in __call__(self, s)
55 return self.valid[s]
56 raise ValueError('Unrecognized %s string "%s": valid strings are %s'
---> 57 % (self.key, s, list(self.valid.values())))
58
59
ValueError: Unrecognized backend string "nbagg": valid strings are ['GTK', 'template', 'svg', 'Qt4Agg', 'GTK3Cairo', 'emf', 'WX', 'GTK3Agg', 'CocoaAgg', 'WebAgg', 'TkAgg', 'agg', 'gdk', 'GTKAgg', 'cairo', 'ps', 'pdf', 'pgf', 'WXAgg', 'MacOSX', 'GTKCairo']
我真的不知道这意味着什么。 显然,我有这个包,所以问题是什么?