1、安装python3.7
更新
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-dev
2、下载python
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
3、解压
tar -xvzf Python-3.7.4.tgz
4、编译安装
./configure
make
sudo make install
5、删除软链接,备份
rm -rf /usr/bin/python3
rm -rf /usr/bin/pip3
6、加入python3的软连接
ln -s /usr/local/bin/python3.7 /usr/bin/python3