title: Matplotlib not found on Jupyter notebook
body: <p>I'm new to command line programming so please bear with me. I've been trying to run matplotlib inline in my Jupyter notebook using the following command:</p>
  <pre><code>%matplotlib inline
  </code></pre>
  <p>and I get the following error</p>
  <pre><code>ModuleNotFoundError                       Traceback (most recent call last)
  &lt;ipython-input-1-88ca88d21acc&gt; in &lt;module&gt;
        2 #We will use this to think about regression
        3 import numpy as np
  ----&gt; 4 get_ipython().run_line_magic('matplotlib', 'inline')
        5 
        6 from sklearn import datasets, linear_model
  
  ~/.pyenv/versions/jupyter3/lib/python3.8/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
     2324                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
     2325             with self.builtin_trap:
  -&gt; 2326                 result = fn(*args, **kwargs)
     2327             return result
     2328 
  
  &lt;decorator-gen-108&gt; in matplotlib(self, line)
  
  ~/.pyenv/versions/jupyter3/lib/python3.8/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):
  
  ~/.pyenv/versions/jupyter3/lib/python3.8/site-packages/IPython/core/magics/pylab.py in matplotlib(self, line)
       97             print(&quot;Available matplotlib backends: %s&quot; % backends_list)
       98         else:
  ---&gt; 99             gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui)
      100             self._show_matplotlib_backend(args.gui, backend)
      101 
  
  ~/.pyenv/versions/jupyter3/lib/python3.8/site-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui)
     3417         &quot;&quot;&quot;
     3418         from IPython.core import pylabtools as pt
  -&gt; 3419         gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
     3420 
     3421         if gui != 'inline':
  
  ~/.pyenv/versions/jupyter3/lib/python3.8/site-packages/IPython/core/pylabtools.py in find_gui_and_backend(gui, gui_select)
      278     &quot;&quot;&quot;
      279 
  --&gt; 280     import matplotlib
      281 
      282     if gui and gui != 'auto':
  
  ModuleNotFoundError: No module named 'matplotlib'
  </code></pre>
  <p>After running both python and Ipython on my command line, I'm confident that both of them are running through the same python 3.8.3 install. I'm not sure why the matplotlib library is not available to the pylabtools.py script if this is the case.</p>
  <p>For reference, I installed everything using the instructions located at <a href="https://medium.com/@henriquebastos/the-definitive-guide-to-setup-my-python-workspace-628d68552e14" rel="nofollow noreferrer">https://medium.com/@henriquebastos/the-definitive-guide-to-setup-my-python-workspace-628d68552e14</a>.</p>