I\'m trying to install django using pip in Terminal.
I always get an exception, however. The last error is always \"permission deni
My Solution for [Errno 13] Permission denied:
Target: To install package into system/virtualenv
Why you get this problem? Because apart from root, other users you created don't have permission to write to site-packages, that is why you get OS error permission denied for that user
How to solve?
Make sure you activated the virtualenv all the time
Source bin/activate
Suppose, I created a user
(sampleEnv) sunny@ubuntu-512mb-lon1-01: pip install django
This will give the Permission error, Instead of that shift to root
$ su -
(sampleEnv) root@ubuntu-512mb-lon1-01: pip install django
Now root have permission to write to site-packages.
Once django is installed. Shift back to user
$ su - sunny
then do pip freeze you can see packages installed in system and go on!
pip
should be run by a user which has permissions to write to site-packages
directory (in your case, /Library/Python/2.7/site-packages/
). You should either run it from the root
user or under sudo
.
sudo pip install django
The error tells you that you can't access a directory (you don't have enough permissions), so you can gain root access via sudo
to get the permissions.