We recommend to use the Python 3 that is available via Red Hat Software Collections. Software collections are part of your RHEL subscription and have their own release cadence so they can be updated more frequently and independent of RHEL OS releases. These are very secure and fully supported by Red Hat. Software collections is now up to Python 3.8. What's great about software collections is that Python 3.8 installations will be exactly the same across your servers - whether you install some today or in 3 months. A problem with other alternatives (e.g. EPEL) is that the package set may be one thing today but be different in 3 months. Also, software collections allow you to install 2 different Pythons in parallel without contention. A lot of RHEL 7 was built on Python 2.7 and installing Python 3 without software collections can potentially (and commonly) break the OS.

To install python 3 on RHEL 7, use these instructions. Installation requires that you need to enable the correct repos, etc. The first time through may be a bit slow, but people have found it to be routine afterwards.

These same software collections are also delivered as Linux containers and can be found in our catalog.

Answer from Mike Guerette on Stack Overflow
๐ŸŒ
Red Hat
developers.redhat.com โ€บ blog โ€บ install-python3-rhel
How to install multiple versions of Python on Red Hat Enterprise Linux | Red Hat Developer
February 27, 2024 - Let's go ahead and install Python 3.9 on RHEL 8: ... Verify this specific installation using: python3.11 --version. In addition, for installing the pip package installer, add on the -pip extension to the version of python being installed, for example: ... $ sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms $ yum group install "Development Tools" While Python 2.7 is the default implementation for RHEL 7, newer versions of the Python interpreter and libraries are available as Red Hat Software Collections packages.
๐ŸŒ
TecAdmin
tecadmin.net โ€บ install-python-3-7-on-centos
How To Install Python 3.7 on CentOS/RHEL 7 & Fedora 34 ...
April 26, 2025 - How to Install Python 3.7.11 on CentOS/RHEL 7/6 & Fedora 34/33. Quickly compile Python 3.7 from source code and install on CentOS and Fedora
Discussions

python - what is the formal latest python3 installtion on rhel 7.X servers - Stack Overflow
I am very confused after searching a while in google , we found many sites that explain how to install python 3 on rhel 7 I want to explain our needs we have productions servers , and we want now t... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to change python default version from 2.7 to 3.7 on RHEL 7 - Unix & Linux Stack Exchange
How to change python default version from 2.7 to 3.7 on RHEL 7. Installed python on RHEL7 virtual machine by following this https://tecadmin.net/install-python-3-7-on-centos/ When I check python More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
September 12, 2018
rhel - How to install python3 with all it is tools on Redhat RHEL7 offline machine - Unix & Linux Stack Exchange
I have a Django project that is ... in an RHEL 7 server with no internet access. I need to include everything locally, starting from python3 source, to pip and setup tools. with every package that the system may need to run python, I have added tons and tons of packages, but still, it gives me error all the time. I'm using this install.sh script to achieve that purpose ยท #!/bin/bash cd ./needed_pkgs/ rpm -i build-essentials-2019-3pclos2019.noarch.rpm ... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
python3 - need a help to find python 3.7 rpm for RHEL 8.4 - Unix & Linux Stack Exchange
We need a Python 3.7 rpm for RHEL 8.4, I am not able to find this on the official python website. Please share the link or redirect where I get this rpm for download. We need this rpm as the CDSW 1.10.2 to come with 3.7 kernels and So to work with the pyspark (Spark 2.4) we need to install python ... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
December 7, 2022
๐ŸŒ
Red Hat
access.redhat.com โ€บ solutions โ€บ 2353081
Python 3 support for Red Hat Enterprise Linux (RHEL) 7 - Red Hat Customer Portal
What is the official RH standpoint on Python 3.x support? Red Hat Enterprise Linux (RHEL) 7 ยท Python 3.x ยท A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more. Log in for full access Log In ยท Learn more about Red Hat subscriptions ยท
๐ŸŒ
GitHub
gist.github.com โ€บ wpupru โ€บ deda1cd96ea242d9a790e50cd0c97e9f
Install Python 3.7.0 on Centos 7 ยท GitHub
sudo su yum install -y wget gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel ; cd /usr/src; wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz ; tar xzf Python-3.7.0.tgz ; cd Python-3.7.0 ; ./configure --enable-optimizations ; make altinstall ; rm -rf /usr/bin/python3 ; ln -s /usr/local/bin/python3.7 /usr/bin/python3 ; python3 -V uname -a ยท Sign up for free to join this conversation on GitHub.
๐ŸŒ
GitHub
gist.github.com โ€บ leosaa โ€บ 211bd0b9738bd27b46138510bd012f60
install python 3.7.0 on RHEL/Centos 6.9 ยท GitHub
PYTHON_VERSION=3.7.0 PYTHON_URL=https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz mkdir $HOME/opt LOCAL=$HOME/opt mkdir $HOME/tmp DL=$HOME/tmp yum install libffi-devel ยท cd ${DL} wget -c https://zlib.net/zlib-1.2.11.tar.gz tar xzvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure --prefix=${LOCAL} make make install
๐ŸŒ
IBM
ibm.com โ€บ support โ€บ pages โ€บ work-around-frustrating-python-3-install-rhel7
Work-around the frustrating Python 3 install on RHEL7
For reasons I cannot fathom, it is very hard to install Python version 3 on RHEL7 - here is my work-around. and reminder for myself. It seems I am not alone on this annoying RHEL 7 missing feature, so I thought I would share the solution.
Find elsewhere
Top answer
1 of 3
9

RHEL 7 and its derivatives depend on Python 2 at a very deep level. If you outright replace Python 2 with 3, you'll break several of the OS's core tools.

Even if that were not the case, your question is based on an incorrect premise, being that completely replacing Python 2 with Python 3 is a good idea in the first place. Instead, install both side-by-side.

How? It starts with the fact that one should always call Python 3 as python3, since that insulates you from the major version compatibility problem. Scripts that assume Python 2 will call it as python in shebang lines and such, so there is not in fact a conflict between the old version and your newer version's python3 binary and everything that depends on it, as long as your binary Python packages are built properly.

That โ€œifโ€ can bite you: some packagers have created Python 3 packages with a /usr/bin/python or similar, which creates a conflict. These packages are ignoring the standard advice, which allows both to be installed in parallel.

As for getting a non-conflicting Python 3 package for RHEL 7, thatโ€™s well covered in another answer on Stack Overflow.

2 of 3
7

I would recommend the alternatives solution

My commands wold be.

#!/bin/bash

alternatives --list | grep -i python
alternatives --install /usr/bin/python python /usr/bin/python2.7 1
alternatives --install /usr/bin/python python /usr/bin/python3.6 2
alternatives --install /usr/bin/python python /usr/local/bin/python3.7 3
alternatives --config python
๐ŸŒ
Google Groups
groups.google.com โ€บ g โ€บ vfx-platform-discuss โ€บ c โ€บ D-rdtZJV4nI
Python 3.7 on CentOS 7 (and 8)
So far we have relied on Python being present in the system or properly installed by the user. For Python 2.7 this was ok as it's the system's default version. But for Python 3.7, I don't know how CentOS 7-8 (or RHEL) users can easily install Python 3.7 binaries.
๐ŸŒ
Turbogeek
turbogeek.co.uk โ€บ home โ€บ linux โ€บ install python 3 on rhel 6/7: legacy build guide
Install Python 3 on RHEL 6/7: Legacy Build Guide - TurboGeek
October 25, 2019 - A legacy RHEL 6 and RHEL 7 Python 3 build guide with lifecycle warnings, source-build notes, and safer migration context for old Red Hat estates.
๐ŸŒ
TecMint
tecmint.com โ€บ home โ€บ python โ€บ how to install latest python from source in linux
How to Install Python in RHEL and Debian Systems
August 10, 2023 - In this article, we will show how to install and use Python in RHEL and Debian-based distributions with core tools that can be used in the Linux command line.
๐ŸŒ
Cloudera
docs.cloudera.com โ€บ cdp-private-cloud-base โ€บ 7.1.9 โ€บ installation โ€บ topics โ€บ cdpdc-cm-install-python-3-rhel7-standard-location.html
Installing Python 3.8 standard package on RHEL 7
July 19, 2024 - The benefit of using Red Hat Software Collections is that you can have multiple versions of Python installed at the same time along with the base Python 2.7 that shipped with RHEL 7. You can easily switch between versions with scl enable. Install Python 3.8 by running the following command:
๐ŸŒ
Quora
quora.com โ€บ How-do-I-install-Python-3-with-all-its-tools-on-a-Red-Hat-RHEL7-offline-machine
How to install Python 3 with all its tools on a Red Hat RHEL7 offline machine - Quora
Answer: Q: How do I install Python 3 with all its tools on a Red Hat RHEL7 offline machine? Use an online machine to download all of the required rpm packages from Red Hatโ€™s repository. You can also use CentOSโ€™s repository as the software is pretty much the same.
๐ŸŒ
TecAdmin
tecadmin.net โ€บ install-python-3-9-on-centos
How to Install Python 3.9 on CentOS/RHEL 7 & Fedora โ€“ TecAdmin
April 26, 2025 - In this tutorial, we will guide you through the process of installing Python 3.9 on CentOS/RHEL 7 and Fedora operating systems using the source archive file.
Top answer
1 of 16
257

Installing from RPM is generally better, because:

  • you can install and uninstall (properly) python3.
  • the installation time is way faster. If you work in a cloud environment with multiple VMs, compiling python3 on each VMs is not acceptable.

Solution 1: Red Hat & EPEL repositories

Red Hat has added through the EPEL repository:

  • Python 3.4 for CentOS 6
  • Python 3.6 for CentOS 7

[EPEL] How to install Python 3.4 on CentOS 6

sudo yum install -y epel-release
sudo yum install -y python34

# Install pip3
sudo yum install -y python34-setuptools  # install easy_install-3.4
sudo easy_install-3.4 pip

You can create your virtualenv using pyvenv:

pyvenv /tmp/foo

[EPEL] How to install Python 3.6 on CentOS 7

With CentOS7, pip3.6 is provided as a package :)

sudo yum install -y epel-release
sudo yum install -y python36 python36-pip

You can create your virtualenv using pyvenv:

python3.6 -m venv /tmp/foo

If you use the pyvenv script, you'll get a WARNING:

$ pyvenv-3.6 /tmp/foo
WARNING: the pyenv script is deprecated in favour of `python3.6 -m venv`

Solution 2: IUS Community repositories

The IUS Community provides some up-to-date packages for RHEL & CentOS. The guys behind are from Rackspace, so I think that they are quite trustworthy...

https://ius.io/

Check the right repo for you here:

https://ius.io/setup

[IUS] How to install Python 3.6 on CentOS 6

sudo yum install -y https://repo.ius.io/ius-release-el6.rpm
sudo yum install -y python36u python36u-pip

You can create your virtualenv using pyvenv:

python3.6 -m venv /tmp/foo

[IUS] How to install Python 3.6 on CentOS 7

sudo yum install -y https://repo.ius.io/ius-release-el7.rpm
sudo yum install -y python36u python36u-pip

You can create your virtualenv using pyvenv:

python3.6 -m venv /tmp/foo
2 of 16
207

It is easy to install python manually (i.e. build from source):

  1. Download (there may be newer releases on Python.org):

     $ wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz
    
  2. Unzip

     $ tar xf Python-3.* 
     $ cd Python-3.*
    
  3. Prepare compilation

     $ ./configure
    
  4. Build

     $ make
    
  5. Install

     $ make install
    

    OR if you don't want to overwrite the python executable (safer, at least on some distros yum needs python to be 2.x, such as for RHEL6) - you can install python3.* as a concurrent instance to the system default with an altinstall:

     $ make altinstall
    

Now if you want an alternative installation directory, you can pass --prefix to the configurecommand.

Example: for 'installing' Python in /opt/local, just add --prefix=/opt/local.

After the make install step: In order to use your new Python installation, it could be, that you still have to add the [prefix]/bin to the $PATH and [prefix]/lib to the $LD_LIBRARY_PATH (depending of the --prefix you passed)

๐ŸŒ
jashealthy
jashealthy.weebly.com โ€บ blog โ€บ install-python-rhel-7
Install python rhel 7 - jashealthy
June 4, 2023 - IUS is a community project and it provides Red Hat Package Manager packages for some newer version of select software, so it can provide the necessary RPM packages, such as: Python3. Method1:...
๐ŸŒ
Reddit
reddit.com โ€บ r/redhat โ€บ how to install python 3, pip, venv, virtualenv, and pipenv on rhel
r/redhat on Reddit: How to install Python 3, pip, venv, Virtualenv, and Pipenv on RHEL
August 13, 2018 - This article shows how to install Python 3, pip, venv, virtualenv, and pipenv on Red Hat Enterprise Linux 7. After following the steps in this article, you should be in a good position to follow many Python guides and tutorials using RHEL.