Why does pip installs a package outside my virtual environment?

pip, python, virtualenv

Solution

I ran into this problem when I renamed the directory containing my virtual environment. The hard path pip was using was no longer correct.

Update the shebang in the pip script to point to your virtual environment's python executable.

Problem

After doing a source of the virtual environment I try ``` pip install -U --no-deps django-social-auth ``` and it returns: ``` OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.6/dist-packages/django_social_auth-0.6.9-py2.6.egg-info/dependency_links.txt' ``` Why is it trying to write outside the virtualenv?

Original source