首先把python默认版本设置为你当前的python
可以参考 修改默认python版本
下载 pip.py
下载完之后
python get-pip.py
就可以了
如果报:
Traceback (most recent call last):
File "get-pip.py", line 22711, in <module>
main()
File "get-pip.py", line 198, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmpyi_284p1/pip.zip/pip/_internal/cli/main.py", line 10, in <module>
File "/tmp/tmpyi_284p1/pip.zip/pip/_internal/cli/autocompletion.py", line 9, in <module>
File "/tmp/tmpyi_284p1/pip.zip/pip/_internal/cli/main_parser.py", line 7, in <module>
File "/tmp/tmpyi_284p1/pip.zip/pip/_internal/cli/cmdoptions.py", line 19, in <module>
ModuleNotFoundError: No module named 'distutils.util'
执行
sudo apt-get install python3-distutils
再执行
python get-pip.py
就可以了
查看pip版本
pip --version
更新pip
sudo pip install -U pip