pip install django error

后端 未结 3 1105
半阙折子戏
半阙折子戏 2020-12-21 13:24

I\'m trying to install django using pip in Terminal.

I always get an exception, however. The last error is always \"permission deni

相关标签:
3条回答
  • 2020-12-21 14:04

    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!

    0 讨论(0)
  • 2020-12-21 14:09

    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.

    0 讨论(0)
  • 2020-12-21 14:11
    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.

    0 讨论(0)
提交回复
热议问题