pip -V pip 21.2.3 from /Library/Python/3.8/site-packages/pip (python 3.8)
pip3 -V pip 21.2.3 from /Library/Python/3.8/site-packages/pip (python 3.8)
pip 和 pip3 指向的实际都是python3,但现在有一段老的python2代码需要调试,如何为python2重新安装pip呢?
curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
但这个脚本已经停止了对python2对支持,最低支持3.6。
应该用以下方法:
curl -o get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2 get-pip.py
成功安装python2版本的pip
pip -V pip 20.3.4 from /Library/Python/2.7/site-packages/pip (python 2.7)
参考:
https://stackoverflow.com/questions/65866417/pip-install-failing-on-python2/65866547#65866547