Skip to content

Instantly share code, notes, and snippets.

@basaks
Last active January 28, 2022 13:00
Show Gist options
  • Save basaks/6a84a896c78138ef0ccce6dfadac8c72 to your computer and use it in GitHub Desktop.
Save basaks/6a84a896c78138ef0ccce6dfadac8c72 to your computer and use it in GitHub Desktop.
Install Python3.6 interpreter on ubuntu 16.04

Install Python3.6 interpreter on ubuntu 16.04

From here, we can pretty much follow the exact same procedure.

On a terminal just do the following steps:

Install dependencies:

sudo apt install build-essential checkinstall libreadline-gplv2-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl

Download and untar the desired version:

mkdir -p $HOME/opt
cd $HOME/opt
curl -O https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar -xzf Python-3.6.4.tgz

Install python3.6 while keeping python3.5 as the default python3 version on ubuntu 16.04.

cd Python-3.6.4/
./configure --enable-shared --enable-optimizations --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
sudo make altinstall

Check it was installed properly:

>> python3.6 -V
Python 3.6.4

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment