python 3
先下载:
curl https://bootstrap.pypa.io/pip/get-pip.py -o get-pip.py
接着安装:
sudo python3 get-pip.py
(注意,如果出现如下图黄字部分警告,如WARNING: The scripts pip, pip3 and pip3.9 are installed in ‘/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin’ which is not on PATH)需要将其添加到path
将你的黄色警告的文件目录部分更换下面PATH=后的目录部分
echo 'export PATH=/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin:$PATH' >>~/.bashrc
使文件生效
source ~/.bashrc
验证:
pip -V