
Now let’s install python-pip and any required packages: yum -y install python-pip If you exit the session or open a new session from another terminal Python 2.7 will be the default Python version. It is important to point out that Python 3.6 is set as the default Python version only in this shell session. If you check the Python version again, you’ll notice that Python 3.6 is the default version in your current shell now. What the command above does is calling the script /opt/rh/rh-python36/enable, which changes the shell environment variables. To access Python 3.6 you need to launch a new shell instance using the Software Collection scl tool: scl enable rh-python36 bash

You will notice that Python 2.7 is the default Python version in your current shell. Once the package rh-python36 is installed, check the Python version by typing: python -version To do so type the following command on your CentOS 7 terminal: sudo yum install rh-python36 Now we will install Python 3.6, which is the latest version available at the time of writing. It is part of the CentOS extras repository and can be installed by running the following command: sudo yum install centos-release-scl

To enable SCL, you need to install the CentOS SCL release file.

SCL allows you to install newer versions of python 3.x alongside the default python v2.7.5 so that system tools such as yum will continue to work properly. By enabling SCL you will gain access to the newer versions of programming languages and services which are not available in the core repositories.ĬentOS 7 ships with Python 2.7.5 which is a critical part of the CentOS base system. Software Collections, also known as SCL is a community project that allows you to build, install, and use multiple versions of software on the same system, without affecting system default packages. To install the necessary tools and libraries type: sudo yum groupinstall 'Development Tools' Development tools are required for building Python modules.
