Skip to content

Instantly share code, notes, and snippets.

@wesky93
Forked from basaks/python36.md
Last active June 2, 2017 14:53
Show Gist options
  • Save wesky93/39e207874fac8e586335e3e336a1d196 to your computer and use it in GitHub Desktop.
Save wesky93/39e207874fac8e586335e3e336a1d196 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.1/Python-3.6.1.tgz
tar -xzf Python-3.6.1.tgz

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

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

Check it was installed properly:

>> python3.6 -V
Python 3.6.1

Enjoy!

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