title: How to get virtualenv to use dist-packages on Ubuntu?
body: <p>I know that virtualenv, if not passed the <code>--no-site-packages</code> argument when creating a new virtual environment, will link the packages in <code>/usr/local/lib/python2.7/site-packages</code> (for Python 2.7) with a newly-created virtual environment. On Ubuntu 12.04 LTS, I have three locations where Python 2.7 packages can be installed (using the default, Ubuntu-supplied Python 2.7 installation):</p>
  
  <ol>
  <li><code>/usr/lib/python2.7/dist-packages</code>: this has my global installation of ipython, scipy, numpy, matplotlib – packages that I would find difficult and time-consuming to install individually (and all their dependences) if they were not available via the <a href="http://www.scipy.org/install.html" rel="noreferrer">scipy stack</a>.</li>
  <li><code>/usr/local/lib/python2.7/site-packages</code>: this is empty, and I think it will stay that way on Ubuntu unless I install a package from source.</li>
  <li><code>/usr/local/lib/python2.7/dist-packages</code>: this has very important local packages for astronomy, notably those related to PyRAF, STScI, etc., and they are extremely difficult and time-consuming to install individually.</li>
  </ol>
  
  <p>Note that a global directory such as <code>/usr/lib/python2.7/site-packages</code> does not exist on my system. Note also that my global installation of ipython, scipy, etc. lets me use those packages <em>on-the-fly</em> without having to source/activate a virtual environment every time.</p>
  
  <p>Naturally, I now want to use virtualenv to create one virtual environment in my user home directory which I will source/activate for my future projects. However, I would like this virtual environment, while being created, to link/copy all of my packages in locations (1) and (3) in the list above. The main reason for this is that I don't want to go through the <code>pip install</code> process (if it is even possible) to re-install ipython, scipy, the astro-packages, etc. for this (and maybe other) virtual environments.</p>
  
  <p>Here are my questions:</p>
  
  <ol>
  <li>Is there a way for me to specify to virtualenv that I would like it to link/copy packages in these two <code>dist-packages</code> directories for virtual environments that are created in the future?</li>
  <li>When I eventually update my global installation of scipy, ipython, etc. in the two <code>dist-packages</code> directories, will this also update/change the packages that my virtual environment uses (and which it originally got during virtualenv creation)? </li>
  <li>If I ever install a package from source on Ubuntu, will it go in <code>/usr/local/lib/python2.7/dist-packages</code>, or <code>/usr/local/lib/python2.7/site-packages</code>?</li>
  </ol>
  
  <p>Thanks in advance for your help!</p>