- setup
python3 -V
apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
apt update
- install python3.7
sudo apt install python3.7
python3.7 --version
- update-alternatives (change python3 to python3.7 binary)
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
sudo update-alternatives --config python3
- check
- install upgrade pip
python3.7 -m pip install pip
- Install requirements
sudo apt-get install -y build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev zlib1g-dev openssl libffi-dev python3-dev python3-setuptools wget
- Prepare to build
mkdir /tmp/Python37
cd /tmp/Python37
- Pull down Python 3.7, build, and install
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xvf Python-3.7.0.tar.xz
cd /tmp/Python37/Python-3.7.0
./configure
sudo make altinstall
wget https ://www.python.org/ftp/ptar xvf python -3.7.0.tar .xx cd /tmp/python 37/python-3.7.0./configure sudo make altinstall