Unable to find virtualenv or django after installing with pip
Question: I installed virtualenv using pip and now receive the following error whenever
I actually try and use it:

    
    
    % virtualenv
    Traceback (most recent call last):
       File "/bin/virtualenv", line 5, in <module>
        from pkg_resources import load_entry_point
       File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2705, in <module>
       File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 668, in require
       File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 571, in resolve
    pkg_resources.DistributionNotFound: virtualenv==1.11.2
    %
    

Similarly, I installed django with pip, and when I try and import django in
python I get: `ImportError: No module named django`.


Answer: I tried to install virtualenv again, this time using easy_install instead of
pip. easy_install gave me an error saying that it was having issues with my
`PYTHONPATH` environment variable. Lo and behold, after reading
<http://www.stereoplex.com/blog/understanding-imports-and-pythonpath>,
`PYTHONPATH` is what python uses to find modules, and my `PYTHONPATH` was
unset.

After setting `PYTHONPATH` to `/lib/python3.3/site-packages` (where pip was
installing my modules), both virtualenv and importing django functioned
properly.

Note: because I have both python2.7 and python 3.3 installed, for me `pip`
actually installs packages to `/lib/python2.7/site-packages` while `pip3`
installs packages to the aforementioned `/lib/python3.3/site-packages`.

For the unfamiliar, information on setting environment variables can be found
here: <https://help.ubuntu.com/community/EnvironmentVariables>

