简体   繁体   English

无法使用Homebrew Python在Mac上升级pip3

[英]Failed to upgrade pip3 on Mac with Homebrew Python

I failed at upgrading pip3 on mac and get confusing (for me) answers in the terminal: 我在Mac上升级pip3失败,并在终端中得到(对我而言)令人困惑的答案:

> which python
/usr/bin/python

> pip -V
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)

> which python3
/usr/local/bin/python3

> python3 -V
Python 3.6.4

> pip3 -V
pip 7.1.0 from /usr/local/lib/python3.6/site-packages (python 3.6)

> sudo -H pip3 install --upgrade pip
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages

> sudo -H pip3 install --upgrade pip3
Could not find a version that satisfies the requirement pip3 (from versions: )
No matching distribution found for pip3

Why can't I have pip3 upgraded to 9.0? 为什么我不能将pip3升级到9.0?


Solution was to force reinstall: 解决方法是强制重新安装:

sudo -H pip3 install --upgrade pip --force-reinstall

Verify that /usr/local/bin/pip3 --version is 9.0.1. 验证/usr/local/bin/pip3 --version为9.0.1。 If not: 如果不:

sudo python3 -m pip install --upgrade pip

Ie, use pip package from that particular Python version. 即,使用该特定Python版本的pip包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM