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
Answer from Samuel Phan on Stack Overflow
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)

🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_enterprise_linux › 9 › html › installing_and_using_dynamic_programming_languages › assembly_installing-and-using-python_installing-and-using-dynamic-programming-languages
Chapter 2. Installing and using Python | Installing and using dynamic programming languages | Red Hat Enterprise Linux | 9 | Red Hat Documentation
Packages prefixed with python3.12- contain add-on modules for Python 3.12. ... Additional Python tools for developers are distributed mostly through the CodeReady Linux Builder (CRB) repository. The python3-pytest package and its dependencies are available in the AppStream repository. The CRB repository contains, for example, the following packages: ... The content in the CodeReady Linux Builder repository is unsupported by Red Hat. ... Not all upstream Python-related packages are available in RHEL. To install packages from the CRB repository, use the following procedure.
Discussions

How to install Python 3, pip, venv, Virtualenv, and Pipenv on RHEL

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.

Using Python virtual environments is a best practice to isolate project-specific dependencies and create reproducible environments. Other tips and FAQs for working with Python and software collections on RHEL 7 are also covered.

There are a number of different ways to get Python 3 installed on RHEL. There are many articles and answers online that give incomplete steps or inappropriate answers for people/enterprises that are running RHEL.

This article uses Red Hat Software Collections because these give you a current Python installation that is built and supported by Red Hat. During development, support might not seem that important to you. However, support is important to those who have to deploy and operate the applications you write. To understand why this is important, consider what happens when your application is in production and a critical security vulnerability in a core library (for example SSL/TLS) is discovered. This type of scenario is why many enterprises use Red Hat.

Python 3.6 is used in this article. It was the most recent, stable release when this was written. However, you should be able to use these instructions for any of the versions of Python in Red Hat Software Collections including 2.7, 3.4, 3.5, and future collections such as 3.7.

I hope this answers a number of questions about software collections and working with Python 3 on RHEL. Feedback is welcome.

More on reddit.com
🌐 r/redhat
6
16
August 13, 2018
rhel - How to install python3 with all it is tools on Redhat RHEL7 offline machine - Unix & Linux Stack Exchange
I need to include everything locally, ... 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
rhel - In Red Hat, how do I system install python 3.6.1 when 2.7.5 is already installed? - Unix & Linux Stack Exchange
In some versions of RHEL with Python ... will install Python 3.x in an alternate location for you, to find them you can do yum list | grep python3. Without knowing what version of RHEL you are concerned with, I cannot be more specific. ... Linux version 3.10.0-514.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Oct 19 11:24: 13 EDT 2016 ... Python 2.7 is needed for the proper operation of RedHat Linux, things ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
July 10, 2017
Python 3 is the default Python implementation in RHEL 8

Red Hat Enterprise Linux 8 is distributed with Python 3.6. The package is not installed by default. To install Python 3.6, use the yum install python3 command.

Python 2.7 is available in the python2 package. However, Python 2 will have a shorter life cycle and its aim is to facilitate smoother transition to Python 3 for customers.

Neither the default python package nor the unversioned /usr/bin/python executable is distributed with RHEL 8. Customers are advised to use python3 or python2 directly. Alternatively, administrators can configure the unversioned python command using the alternatives command.

For details, see Using Python 3 in Red Hat Enterprise Linux 8.

(BZ#1580387)

More on reddit.com
🌐 r/Python
23
75
November 15, 2018
🌐
nixCraft
cyberciti.biz › nixcraft › howto › package management › rhel 8 install python 3 or python 2 using yum
RHEL 8 install Python 3 or Python 2 using yum - nixCraft
May 23, 2024 - Type the following yum command to install Python 3 on Red Hat Enterprise Linux version 8: sudo yum install python3 OR sudo yum module install python36 Verify installation by typing the type command/command command: $ type -a python3 python3 ...
🌐
Red Hat
developers.redhat.com › articles › 2025 › 09 › 22 › install-python-313-red-hat-enterprise-linux-epel
Install Python 3.13 on Red Hat Enterprise Linux from EPEL | Red Hat Developer
September 22, 2025 - Learn how to install Python 3.13 on Red Hat Enterprise Linux and CentOS Stream using the Extra Packages for Enterprise Linux (EPEL) repository.
🌐
Readthedocs
fire-insights.readthedocs.io › en › latest › installation › python-install-linux.html
Python Installation on Linux - Redhat/CentOS — Sparkflows 0.0.1 documentation
Python is only needed if you need to use Python and the PySpark engine in Fire Insights. Python modules in Fire Insights use Python 3.7+. ... Python installation requires the GCC compiler to be available on the machine.
Find elsewhere
🌐
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 - developers.redhat.com Open Share · Add a comment · Sort by: Best · Open comment sort options · Best · Top · New · Controversial · Old · Q&A · rctrh · • · • · This article shows how to install Python 3, pip, venv, virtualenv, and pipenv on Red Hat Enterprise Linux 7.
🌐
Super User
superuser.com › questions › 1699276 › how-to-install-python-3-in-rhel-in-such-a-way-that-it-wont-mess-up-the-current
linux - How to install Python 3 in RHEL in such a way that it won't mess up the current Python 2 installation? - Super User
For scripts you want to start with python3 start them via <path-to-python3>/python3 script.py or modify the shebang entry in the script's first line to point to your python3 installation.
🌐
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 - This article shows how to install Python on Red Hat Enterprise Linux (RHEL), including both versions 3 and 2 of Python along with the pip, vent, virtualenv, and pipenv utilities. The article starts
🌐
Reddit
reddit.com › r/python › python 3 is the default python implementation in rhel 8
r/Python on Reddit: Python 3 is the default Python implementation in RHEL 8
November 15, 2018 - Red Hat Enterprise Linux 8 uses Python 3.6 by default. However, Python 2.7 is also provided to support existing software. ... Also see Petr Viktorin's blog article on developers.redhat.com/blog - Python in RHEL 8. It's also worth nothing that python 3.6 is used as the internal "platform python" for yum4 (dnf) and other Linux admin tools.
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › starting › install3 › linux
Installing Python 3 on Linux — The Hitchhiker's Guide to Python
This will always launch the Python 3 interpreter. The two most crucial third-party Python packages are setuptools and pip. Once installed, you can download, install and uninstall any compliant Python software product with a single command.
🌐
IBM
ibm.com › support › pages › work-around-frustrating-python-3-install-rhel7
Work-around the frustrating Python 3 install on RHEL7
So I need Python 3 on RHEL - I thought this install would take only a few seconds by using yum on Red Hat as I have the repositories already setup. But installing Python 3 on RHEL 7.6 - it took me about 2 hours of frustration. Python 2.7 was there in the initial installation.
🌐
Python Forum
python-forum.io › thread-24366.html
How to install the latest version of Python on RHEL 8?
This is really frustrating. I am looking for the 'installation and configuration' forum on this site, and cannot seem to find it. Is it that no one anywhere has installation and configuration problems with Python ever?
🌐
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 ·
🌐
Medium
medium.com › @sahildrive007 › installing-python-3-11-on-rhel-8-server-9fea12c2f6ee
Installing Python 3.11 on RHEL 8 server - sahil suri - Medium
July 4, 2024 - 6. Configure and Compile Python: cd Python-3.11.3 ./configure — enable-optimizations make -j$(nproc) ... This will install Python 3.11.3 without replacing the system’s default Python 3 version.