我按照在线说明如何在macOS上安装pip
(例如this,this和this)。
我似乎都很简单,但它对我不起作用。
我的python --version
是2.7.10。
当我运行sudo easy_install pip
时,我得到:
$ sudo easy_install pip
Password:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
知道如何解决或解决这个问题吗?
使用brew for Macs
“brew install python”
这将带有pip以及python2和python3
绕过2个python版本(如果你想)的说明是在https://pip.readthedocs.io/en/stable/installing/
否则,它只是“python3 <'program'>”
以下是如何安装brew:https://www.howtogeek.com/211541/homebrew-for-os-x-easily-installs-desktop-apps-and-terminal-utilities/
你可能有pip3。用它来升级点子。
pip3 install --upgrade pip
easy_install已被弃用。请改用以下命令。
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py