If you’re using Ubuntu 16.04 (a.k.a. Xenial), install Python 3.6 as follows:
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt-get install python3.6
To verify you’re running Ubuntu 16.04, ensure you get the following output:
$ lsb_release -a Release: 16.04
If output of above command is “Release: 18.04”, Python 3.6 should already be installed, since Ubuntu 18.04 ships with it by default.