$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt-get update
$ sudo apt-get install python3.6
$ sudo apt-get install build-essential checkinstall python-dev python-setuptools python-pip python-smbus
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
下载安装
$ cd /usr/src
$ sudo wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
$ sudo tar xzf Python-3.7.0.tgz
$ cd Python-3.7.0
$ sudo ./configure --enable-optimizations
$ sudo make install
软链接兼容命令
$ sudo ln -s /usr/local/bin/python3 /usr/bin/python3