Permission denied error when trying to install pip in Mac OS X Lion

后端 未结 4 1676
一整个雨季
一整个雨季 2020-12-31 07:36

I\'m trying to install pip on a Mac (OS X Lion). It doesn\'t seem to work. I use sudo and prompted for password.

$ sudo curl https://raw.github.com/pypa/pip/         


        
相关标签:
4条回答
  • 2020-12-31 08:19

    curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python

    0 讨论(0)
  • 2020-12-31 08:20

    You are running the curl (download) command under sudo, but the python process itself is running without elevated privileges.

    Run it like this instead:

    $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
    $ sudo python get-pip.py
    

    Alternatively, use the sudo command on the python part of the pipe instead:

    $ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
    
    0 讨论(0)
  • 2020-12-31 08:33

    I met the same question. And I fix it by the following steps:

    1. Download the get-pip.py script from this url https://pip.pypa.io/en/stable/installing/#upgrading-pip

    2. In terminal use this command : sudo python get-pip.py

    3. Yahoo! Successfully installed!

    0 讨论(0)
  • 2020-12-31 08:35

    Might be because you don't have permission to python folder. Please try this, it worked for me.

    • $ sudo chown -R $USER /Library/Python/2.7
    0 讨论(0)
提交回复
热议问题