1In RHEL & CENTOS::
2Step 1: Open a Terminal and add the repository to your Yum install.
3
4sudo yum install -y https://repo.ius.io/ius-release-el7.rpm
5
6Step 2: Update Yum to finish adding the repository.
7
8sudo yum update
9
10Step 3: Download and install Python.
11
12sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
13
14For verification ::
15
16python3.6 -V
17
18In ubuntu ::
19
20$ sudo apt-get update
21$ sudo apt-get install python3.6
22