1. 更新前查看下版本:
使用 pip -V 查看当前的pip版本:
➜ log git:(master_6.0.0) ✗ pip -V
pip 9.0.3 from /Users/mymac/.pyenv/versions/3.6.5/lib/python3.6/site-packages (python 3.6)
2. 将pip更新到最新版本:
使用 python -m pip install -U pip 将pip更新到最新版本。
➜ log git:(master_6.0.0) ✗ python -m pip install -U pip
Collecting pip
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 11kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Successfully installed pip-19.2.3
3. 查看更新后的版本:
继续使用 pip -V查看版本:
➜ log git:(master_6.0.0) ✗ pip -V
pip 19.2.3 from /Users/mymac/.pyenv/versions/3.6.5/lib/python3.6/site-packages/pip (python 3.6)
此时pip已被更新到19.2.3版本了。