title: Python not finding installed packages through pip on Linux
body: <p>I've been trying to install some new python packages with pip, but for some reason, python is not finding them after installation. This started when I purged my whole install of python, and reinstalled it using apt-get. I installed:</p>
  
  <pre><code>python
  python2.7
  python2.7-dev
  python-setuptools
  </code></pre>
  
  <p>When I run:</p>
  
  <pre><code>sudo pip list
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>decorator (3.4.0)
  flann (1.8.4)
  ipython (3.2.0)
  itsdangerous (0.24)
  MarkupSafe (0.23)
  numpy (1.9.2)
  pexpect (3.1)
  pip (7.1.0)
  setuptools (18.0.1)
  simplegeneric (0.8.1)
  Werkzeug (0.10.4)
  </code></pre>
  
  <p>so numpy is listed as installed. In addition, a </p>
  
  <pre><code>locate numpy
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>/usr/bin/dh_numpy
  /usr/include/numpy
  /usr/include/python2.7/numpy
  /usr/lib/python2.7/dist-packages/numpy
  /usr/lib/python2.7/dist-packages/IPython/external/decorators/_numpy_testing_noseclasses.py
  /usr/lib/python2.7/dist-packages/IPython/external/decorators/_numpy_testing_noseclasses.pyc
  /usr/lib/python2.7/dist-packages/IPython/external/decorators/_numpy_testing_utils.py
  /usr/lib/python2.7/dist-packages/IPython/external/decorators/_numpy_testing_utils.pyc
  /usr/local/lib/python2.7/dist-packages/numpy
  /usr/local/lib/python2.7/dist-packages/numpy-1.9.2.egg-info
  /usr/share/numpy
  /usr/share/doc/python-numpy
  /usr/share/man/man1/dh_numpy.1.gz
  /var/lib/dpkg/info/python-numpy.list
  /var/lib/dpkg/info/python-numpy.md5sums
  /var/lib/dpkg/info/python-numpy.postinst
  /var/lib/dpkg/info/python-numpy.preinst
  /var/lib/dpkg/info/python-numpy.prerm
  </code></pre>
  
  <p>so it seems like the installation is alright. But if I try to import it from python, I get an import error. I've tried many things, like purging the entire python installation, purging pip, easy_install and reinstalling all that, massing with the PYTHONPATH and PYTHONHOME variables, and so forth. For reference, echoing the variables PYTHONPATH returns empty and PYTHONHOME returns:</p>
  
  <pre><code>/usr
  </code></pre>
  
  <p>In addition, the sys.path variable contains:</p>
  
  <pre><code>['',
   '/usr/local/bin',
   '/usr/lib/python2.7',
   '/usr/lib/python2.7/plat-x86_64-linux-gnu',
   '/usr/lib/python2.7/lib-tk',
   '/usr/lib/python2.7/lib-old',
   '/usr/lib/python2.7/lib-dynload',
   '/usr/local/lib/python2.7/dist-packages',
   '/usr/lib/python2.7/dist-packages',
   '/usr/lib/python2.7/dist-packages/IPython/extensions']
  </code></pre>
  
  <p>So it is looking in both the /usr/lib/python2.7 directories and in /usr/local/lib/python2.7. Given this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/27628814/python-packages-not-available-after-install-with-pip">Python packages not available after install with pip</a></p>
  
  <p>I suspect this has something to do with the installation of python that pip is serving. But I only have python in /usr/bin, and not in /usr/local/bin, so I have no idea why pip is installing in local. Plus, as the sys.path variable shows, python should be looking into /usar/local/python2.7 as well. Other packages such as flask, bitarray, and redis have this problem as well. Thank you for the help!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Another important information to add: <code>which -a python</code> outputs <code>/usr/bin/python</code>, so the python being used is in /usr/bin.</p>