How to fix default Python path after installing Virtualenv
Question: I installed virtualenv via `sudo pip install virtualenv` and created some
environments. But now I'm finding my default "global" Python path is
completely gone.

In a fresh terminal, I see output like:

    
    
    user@localhost:~$ sudo pip install django
    Requirement already satisfied (use --upgrade to upgrade): django in /usr/local/lib/python2.7/dist-packages
    Cleaning up...
    user@localhost:~$ ls /usr/local/lib/python2.7/dist-packages/django
    bin   contrib  db        forms  __init__.py   middleware  template      test   views
    conf  core     dispatch  http   __init__.pyc  shortcuts   templatetags  utils
    user@localhost:~$ python
    Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
    [GCC 4.6.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import django
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named django
    >>> 
    

What's going on here? How do I fix my global Python installation so that it
can see its installed packages?


Answer: This problem was my own fault. I had accidentally run `virtualenv --no-site-
packages .` in my home directory, creating folders like ~/bin, ~/local, ~/lib,
and Python was looking for its packages there, where there were none. Deleting
these directories fixed the problem.

