Step 1 – Prerequsiteis
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 libffi-dev
Step 2 – Download Python 3.7
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
sudo tar xzf Python-3.7.3.tgz
Step 3 – Compile Python Source
cd Python-3.7.3
sudo ./configure --enable-optimizations
sudo make altinstall
Step 4 – Check Python Version
python3.7 -V
转载于:https://blog.51cto.com/13766835/2390604