1.安装3.7
添加源
sudo add-apt-repository ppa:deadsnakes/ppa
检查更新
sudo apt-get update
安装python3.7
sudo apt-get install python3.7
2.使用 update-alternatives 来为整个系统更改Python 版本
查看python替代版本信息
~$ update-alternatives --display python
但是结果为
update-alternatives: error: no alternatives for python
python的替代版本尚未被update-alternatives
查看python的位置
![](https://img-blog.csdnimg.cn/img_convert/dcfca79b361a46ad8816a1195add5c3f.png)
更新一下替代列表
查看python替代版本信息
![](https://img-blog.csdnimg.cn/img_convert/cb5d7b60309d6166a21cc80532f3a7fe.png)
切换版本
![](https://img-blog.csdnimg.cn/img_convert/a19eb86a9e9c458748d012dcc4fdd297.png)
安装pip
sudo apt install python3-pip
![](https://img-blog.csdnimg.cn/img_convert/e3dec886bf0b77b54b8a4ff188a678a3.png)