In this guide, we’ll cover how to install python 3.6 on Ubuntu 16.04, CentOS 7, Debian 9 and macOS. Most Linux distributions come with python2.7, which is set as the default version of python system-wide.

As of this writing, the current version Python is 3.6. Python 3.0 is end-of-life with the release of Python 3.1. All users of Python 3.0.x should upgrade to the most recent version of Python 3.

Install Python 3.6 on Ubuntu 16.04

On Ubuntu 16.04, Python 2.7 and Python 3.5 are installed by default. To have the latest version of Python 3.6 installed on your Ubuntu 16.04 server follow these steps.

Step 1: Check the version of Python 3 on Ubuntu 16.04

$ python3 -V
Python 3.5.2

You can see here it is 3.5.2. The easiest way to Install Python 3.6 on Ubuntu 16.04 is from J Fernyhough’s Personal Package Archive (PPA).

Step 2: Ensure you have these packages installed before adding the PPA.

Step 5: Install Python 3.6 on Ubuntu 16.04

Step 6: Verify Install of Python 3.6 on Ubuntu 16.04

Check the version of Python 3 present on your system.

$ python3 -V

Install Python 3.6 on CentOS 7

For CentOS 7, you can install Python 3.6 from IUS Community Project CentOS repository. IUS is a community project that provides RPM packages for newer versions of select software for Enterprise Linux distributions.

Step 1: Add IUS Community Project repository

Install repository rpm which will add repository content for you to /etc/yum.repos.d directory.

Install Python 3.6 on macOS

To get Python 3.6 installed on your macOS machine, go to Python Download page and pull the latest release of Python 3.6 for mac. You can also use wget or similar commands to download the package directly without using a web browser.