title: Matplotlib AttributeError: module 'matplotlib.cbook' has no attribute '_define_aliases'
body: <p>When trying to plot a graph on jupyter with pyplot I am running the following code:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  plt.plot([1,2,3,4])
  plt.ylabel('some numbers')
  plt.show()
  </code></pre>
  
  <p>This is returning the following error:</p>
  
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-16-51b004b519a9&gt; in &lt;module&gt;()
  ----&gt; 1 get_ipython().run_line_magic('matplotlib', 'inline')
        2 
        3 
        4 import matplotlib.pyplot as plt
        5 plt.plot([1,2,3,4])
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
     2129                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
     2130             with self.builtin_trap:
  -&gt; 2131                 result = fn(*args,**kwargs)
     2132             return result
     2133 
  
  &lt;decorator-gen-108&gt; in matplotlib(self, line)
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\IPython\core\magic.py in &lt;lambda&gt;(f, *a, **k)
      185     # but it's overkill for just that one bit of state.
      186     def magic_deco(arg):
  --&gt; 187         call = lambda f, *a, **k: f(*a, **k)
      188 
      189         if callable(arg):
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\IPython\core\magics\pylab.py in matplotlib(self, line)
       97             print("Available matplotlib backends: %s" % backends_list)
       98         else:
  ---&gt; 99             gui, backend = self.shell.enable_matplotlib(args.gui)
      100             self._show_matplotlib_backend(args.gui, backend)
      101 
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\IPython\core\interactiveshell.py in enable_matplotlib(self, gui)
     3049                 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
     3050 
  -&gt; 3051         pt.activate_matplotlib(backend)
     3052         pt.configure_inline_support(self, backend)
     3053 
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\IPython\core\pylabtools.py in activate_matplotlib(backend)
      308     matplotlib.rcParams['backend'] = backend
      309 
  --&gt; 310     import matplotlib.pyplot
      311     matplotlib.pyplot.switch_backend(backend)
      312 
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\matplotlib\pyplot.py in &lt;module&gt;()
       30 from cycler import cycler
       31 import matplotlib
  ---&gt; 32 import matplotlib.colorbar
       33 import matplotlib.image
       34 from matplotlib import rcsetup, style
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\matplotlib\colorbar.py in &lt;module&gt;()
       28 import matplotlib.artist as martist
       29 import matplotlib.cbook as cbook
  ---&gt; 30 import matplotlib.collections as collections
       31 import matplotlib.colors as colors
       32 import matplotlib.contour as contour
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\matplotlib\collections.py in &lt;module&gt;()
       17 
       18 import matplotlib as mpl
  ---&gt; 19 from . import (_path, artist, cbook, cm, colors as mcolors, docstring,
       20                lines as mlines, path as mpath, transforms)
       21 
  
  c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\matplotlib\lines.py in &lt;module&gt;()
      206 
      207 
  --&gt; 208 @cbook._define_aliases({
      209     "antialiased": ["aa"],
      210     "color": ["c"],
  
  AttributeError: module 'matplotlib.cbook' has no attribute '_define_aliases'
  </code></pre>
  
  <p>My matplotlib has always worked fine without the jupyter. I have tried a complete reinstall of matplotlib, jupyter and python again since but still getting the same error. Maybe someone had the same problem?</p>