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

[亡魂溺海] 提交于 2019-11-30 08:35:38

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

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!

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

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!