How to install python3.6 in window ubuntu bash

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

NOTICE: This solution no longer works as the apt repository has been disabled by it's creator. More details available here.

Therefore as Ubuntu 16.04 LTS will not be supported after April 30th 2021. The best solution is where possible to upgrade to Ubuntu 20.04 LTS.

Old answer for posterity ...

The other answer is completely correct, however if you need pip as well (I would find it hard to use Python without pip), you would also need to install pip from inside a Virtual Environment (venv). First install Python 3.6 as previously stated ...

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

In each Python 3.6 project create a venv (from inside the projects directory) and install pip like so ...

python3.6 -m venv env --without-pip
source env/bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python3