Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am attempting to install django to a virtualenv that already exists.

Following the instructions listed on the pip-install website here, I ran the following from SSH.

name@server:~$ . myenv.env/bin/activate
(myenv.env)nam@server:~$ pip install django

However at the bottom of the installation, I am seeing this:

creating /usr/local/lib/python2.7/dist-packages/django

error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied

It appears that it is trying to install it to the global directory. I do not have sudo privileges. Am I doing something wrong here?

Update: $PATH = /var/django/myenv.env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

share|improve this question
    
Does it work correctly for other packages? Do you have the same problem if you use easy_install? –  larsks Jul 26 '13 at 17:28
    
Same problem with other packages. And I believe easy_install requires sudo and would install into the global directory. –  Luke Sapan Jul 26 '13 at 17:53
    
Nope, setting up a virtualenv gets you easy_install as well as pip. You can type which easy_install to see if you're using your virtualenv or the system one. –  larsks Jul 26 '13 at 17:55
    
Actually, are you sure you're running pip from inside the virtualenv? What does which pip yield? And do you see pip inside myenv.env/bin/? –  larsks Jul 26 '13 at 17:56
    
I do see pip inside of myenv.env/bin/. I just tried "activating" my env again, and despite being in that mode, "which pip" and "which easy_install" both return "usr/local/bin/pip" and "usr/bin/easy_install" respectively. –  Luke Sapan Jul 26 '13 at 18:20

3 Answers 3

I had the same problem and this worked with me. Try sudo pip install django

share|improve this answer
    
Sry @LukeSapan I didn't read your question right "I do not have sudo privileges." –  Abdullah Dec 3 '13 at 11:45

I had this same problem.

I deleted the virtual environment and created a new one, which solved the problem.

Probably not the answer you were hoping for, but since it's the only one...

share|improve this answer

Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your requirements file and it should work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.