title: Updating matplotlib in virtualenv with pip
body: <p>I am trying to update my <code>matplotlib</code> in virtualenv and now it seems everything crashed :(<br>
  what I did till now is basically, </p>
  
  <pre><code>source ~/myenv/bin/activate
  pip install -U matplotlib
  </code></pre>
  
  <p>I had previously <code>matplotlib 1.3</code> now if I activate py virtual environment and check the <code>matplotlib version</code> it shows <code>2.1</code>    </p>
  
  <p>but I cannot import <code>Axes3D</code> from matplotlib. </p>
  
  <pre><code>&gt;&gt;&gt; import importlib
  &gt;&gt;&gt; importlib.import_module('mpl_toolkits.mplot3d').__path__
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/nld/python-2.7.6-freya/lib/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
    File "/home/usr/vir_python/lib/python2.7/site-packages/mpl_toolkits/mplot3d/__init__.py", line 6, in &lt;module&gt;
      from .axes3d import Axes3D
    File "/home/usr/vir_python/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 32, in &lt;module&gt;
      from matplotlib.cbook import _backports
  ImportError: cannot import name _backports
  </code></pre>
  
  <p>I working on linux platform and using Python 2.7.   </p>
  
  <p>Further problem, I saw, </p>
  
  <p>If I just open virtual python, without activating the virtualenv, I get <code>matplotlib 2.1</code> </p>
  
  <pre><code>$:~&gt; myenv/bin/python 
  Python 2.7.6 (default, Apr 15 2014, 11:17:36) 
  [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import matplotlib
  &gt;&gt;&gt; matplotlib.__version__
  '2.1.0'
  </code></pre>
  
  <p>but if I activate the virtual environment and then open the virtual python with I get <code>matplotlib 1.3.1</code> or old matplotlib. </p>
  
  <pre><code>$:~&gt; source myenv/bin/activate
  (vir_python)$:~&gt; myenv/bin/python
  Python 2.7.6 (default, Apr 15 2014, 11:17:36) 
  [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import matplotlib
  &gt;&gt;&gt; matplotlib.__version__
  '1.3.1'
  </code></pre>
  
  <p>I did the following as per Karthik's suggestion :   </p>
  
  <p>First activated the virtual python</p>
  
  <pre><code>(vir_python) $: pip install matplotlib==2.1.0
  (vir_python) $: pip freeze
  backports.functools-lru-cache==1.4
  backports.ssl-match-hostname==3.4.0.2
  cycler==0.10.0
  imageio==2.1.2
  Jinja2==2.7.2
  MarkupSafe==0.19
  matplotlib==1.3.1
  mpi4py==2.0.0
  nose==1.3.1
  numpy==1.12.0
  olefile==0.44
  pandas==0.19.2
  Pillow==4.0.0
  pyparsing==2.0.1
  python-dateutil==2.6.0
  pytz==2016.10
  scipy==0.19.0
  six==1.10.0
  subprocess32==3.2.7
  svg.path==1.1
  tornado==3.2
  virtualenv==1.11.4
  </code></pre>