Ubuntu 16.04 LTS 下安装Python 3.7

1. 安装software-properties-common

sudo apt-get install software-properties-common

2. 下载python3.7

sudo add-apt-repository ppa:jonathonf/python-3.7
sudo apt-get update
sudo apt-get install python3.7

3. 修改系统默认python版本为3.7

cd /usr/bin
sudo rm python
sudo ln -s python3.7m python

1.png

4. 升级pip版本

sudo pip3 install --upgrade pip

.>若升级失败,未找到pip,尝试如下操作后再次更新:

sudo apt-get install python3-pip
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

2.png

搞定,收工!