Requirements
- CentOS 7 or Red Hat Enterprise Linux 7
Install Software Collections
The first step is to install the utilities needed to manage collections.
yum -y install scl-utils
The next step is to identify which software collection you want and to install the associated repository. A full list of available collections can be found at the following URL.
https://www.softwarecollections.org/en/scls/
The Python33 collection repository package can be installed directly using RPM.
rpm -Uvh https://www.softwarecollections.org/en/scls/rhscl/python33/epel-7-x86_64/download/rhscl-python33-epel-7-x86_64.noarch.rpm
Install Python 3
The Python 3 collection can now be installed using YUM.
yum -y install python33
Use Python 3
Python 3.3 will become accessible by launching a new shell instance using the Software Collection scl command.
scl enable python33 bash
The -V parameter will confirm the available Python version.
python -V
Additional Python libraries and tools, such as pip, can now be installed.
easy_install pip
It is important to remember to use the appropriate path to the new Python binary in your code.
#!/opt/rh/python33/root/usr/bin/python