The objective is to install Python 3 on CentOS 7 with Software Collections (SCL).
Operating System and Software Versions
- Operating System: – CentOS 7 or higher
Privileged access to your Ubuntu System as root or via
sudo command is required.
- # – requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ – given linux commands to be executed as a regular non-privileged user
Default Python Version
$ python --version
Set up Software Collections (SCL)
The following command will install Software Collections and allow you to run applications from SCL shell:
$ sudo yum install centos-release-scl scl-utils-build
Install Python 3
At this stage we are ready to install Python 3. To do so execute the following command on your CentOS 7 system’s terminal:
$ sudo yum install python33
Run applications under Python 3
The Python 2 is still your default shell. However, to run application under Python 3 you first need to enter the SCL shell with Python 3 installation. The following command will do just that:
$ scl enable python33 bash
Next, check your Python version:
$ python --version Python 3.3.2
Now you are ready to start any of your applications from SCL shell using Python 3 as a default python interpreter.