python - iPython notebook error when trying to load matplotlib -
i'm trying learn pandas watching video: https://www.youtube.com/watch?v=5jnmutdy6fw. downloaded notebooks (https://github.com/brandon-rhodes/pycon-pandas-tutorial/), , loaded exercises-1. first block
%matplotlib inline import pandas pd
is giving me error:
--------------------------------------------------------------------------- importerror traceback (most recent call last) <ipython-input-10-5761ac74df30> in <module>() ----> 1 get_ipython().magic(u'matplotlib inline') 2 import pandas pd /users/***/anaconda/lib/python2.7/site-packages/ipython/core/interactiveshell.pyc in magic(self, arg_s) 2305 magic_name, _, magic_arg_s = arg_s.partition(' ') 2306 magic_name = magic_name.lstrip(prefilter.esc_magic) -> 2307 return self.run_line_magic(magic_name, magic_arg_s) 2308 2309 #------------------------------------------------------------------------- /users/***/anaconda/lib/python2.7/site-packages/ipython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line) 2226 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals 2227 self.builtin_trap: -> 2228 result = fn(*args,**kwargs) 2229 return result 2230 /users/***/anaconda/lib/python2.7/site-packages/ipython/core/magics/pylab.pyc in matplotlib(self, line) /users/***/anaconda/lib/python2.7/site-packages/ipython/core/magic.pyc in <lambda>(f, *a, **k) 191 # it's overkill 1 bit of state. 192 def magic_deco(arg): --> 193 call = lambda f, *a, **k: f(*a, **k) 194 195 if callable(arg): /users/***/anaconda/lib/python2.7/site-packages/ipython/core/magics/pylab.pyc in matplotlib(self, line) 86 """ 87 args = magic_arguments.parse_argstring(self.matplotlib, line) ---> 88 gui, backend = self.shell.enable_matplotlib(args.gui) 89 self._show_matplotlib_backend(args.gui, backend) 90 /users/***/anaconda/lib/python2.7/site-packages/ipython/core/interactiveshell.pyc in enable_matplotlib(self, gui) 3087 """ 3088 ipython.core import pylabtools pt -> 3089 gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select) 3090 3091 if gui != 'inline': /users/***/anaconda/lib/python2.7/site-packages/ipython/core/pylabtools.pyc in find_gui_and_backend(gui, gui_select) 237 """ 238 --> 239 import matplotlib 240 241 if gui , gui != 'auto': /users/***/library/enthought/canopy_64bit/user/lib/python2.7/site-packages/matplotlib/__init__.py in <module>() 178 # cbook must import matplotlib within function 179 # definitions, safe import here. --> 180 matplotlib.cbook import is_string_like 181 matplotlib.compat import subprocess 182 /users/***/library/enthought/canopy_64bit/user/lib/python2.7/site-packages/matplotlib/cbook.py in <module>() 31 weakref import ref, weakkeydictionary 32 ---> 33 import numpy np 34 import numpy.ma ma 35 /users/***/library/enthought/canopy_64bit/user/lib/python2.7/site-packages/numpy/__init__.py in <module>() 183 return loader(*packages, **options) 184 --> 185 . import add_newdocs 186 __all__ = ['add_newdocs', 187 'moduledeprecationwarning', /users/***/library/enthought/canopy_64bit/user/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>() 11 __future__ import division, absolute_import, print_function 12 ---> 13 numpy.lib import add_newdoc 14 15 ############################################################################### /users/***/library/enthought/canopy_64bit/user/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>() 15 .ufunclike import * 16 ---> 17 . import scimath emath 18 .polynomial import * 19 #import convertcode importerror: cannot import name scimath
can tell me what's happening , how can fix it?
you can read similar issue here , here.
the main problem importing scimath: "importerror: cannot import name scimath"
you can try import scimath.
a better solution set pythonpath var, provides python interpreter additional directories in python packages/modules. can read more setting pythonpath variable here.
Comments
Post a Comment