Install Python 3.6 on Debian8 Jessie

I just had to do this, I find whenever I build python from source I have many issues (the 2 most annoying are not having a history when pressing the up key and getting an _sqlite module not available! Both can be fixed but it's just annoying having to fix them).

So to answer your question, the best way is to add Felix Krull's deadsnakes PPA at; https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa;

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6

There is also J Fernyhough's PPA at;
https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6;

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

Then rather than calling python3 we call python3.6


As Ubuntu is Debian based, and so long as you have a standard install adding Ubuntu PPA's has always worked out fine for me. I have used this on Linux Mint 18.1, 18.3, and a Debian version I fail to recall, but never had any issues.


It's worth noting that to add the PPA's, you will need the software-properties-common package installed.

Without this, you'll get:

bash: add-apt-repository: command not found

Or something similar. To fix this, simply run:

sudo apt-get install software-properties-common

And it'll install the add-apt-repository command for you!