无法在mac上安装python3的pip

时间:2014-01-28 20:27:44

标签: macos pip

当我跑步时

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

它给了我这个错误:

Downloading/unpacking pip
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /var/root/.pip/pip.log

但是,如果我只是运行:

sudo python get-pip.py

没有问题:

Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.2-py2.py3-none-any.whl#md5=445a893564065937c0f31ac2cc8e2f35
  Downloading pip-1.5.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.1
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...

有人可以帮忙吗?谢谢!

1 个答案:

答案 0 :(得分:0)

这是一个简单的权限问题。如果您要安装到系统Python安装,则应该需要root,这是sudo提供的。

如果您需要安装没有root权限的东西,则需要查看Python virtual environments