升級Ubuntu安裝包
sudo apt update
sudo apt install software-properties-common
安裝python PPA
sudo add-apt-repository ppa:deadsnakes/ppa
安裝指定版本python
sudo apt install python3.8
查看python版本
python3.8 --version
安裝pip3
sudo apt install python3-pip
修改系統(tǒng)默認(rèn)版本為python3.8
刪除默認(rèn)的Python3軟鏈接:
sudo rm /usr/bin/python3
然后創(chuàng)建一個新的軟鏈接指向需要的Python3版本:
sudo ln -s /usr/bin/python3.8 /usr/bin/python3