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
🌐
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
Red Hat does not support software installed by using pip at the system level. To avoid these issues, use pip within a virtual environment or install packages as a non-root user with the --user option. ... $ python3.11 $ python3.11 -m venv --help $ python3.11 -m pip install package $ pip3.11 ...
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)

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
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
🌐
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 - Install whatever additional modules ... can be summarized in the following commands: $ python3 -m venv py36-venv $ source py36-venv/bin/activate (py36-venv) $ python3 -m pip install ...some modules......
🌐
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 - sudo dnf install python3.13 · To verify the installation, check the version (the printed value should be Python 3.13.7 or similar): python3.13 --version · The EPEL repository provides the core Python 3.13 interpreter, its standard library, ...
🌐
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 - Install Python 3.8 by running the following command: ... scl enable rh-python38 -- pip install --upgrade pip scl enable rh-python38 -- pip install psycopg2-binary
🌐
Readthedocs
fire-insights.readthedocs.io › en › latest › installation › python-install-linux.html
Python Installation on Linux - Redhat/CentOS — Sparkflows 0.0.1 documentation
Python Installation on Linux - Redhat/CentOS · Edit on GitHub · 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+. Use the below commands: python --version python3.7 --version ·
Find elsewhere
🌐
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 ...
🌐
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 - They contain updated versions of many of the tools that are included with RHEL, but can be installed in parallel without breaking anything because they install in /opt/rh. You need to get /opt/rh/... in your path, which is done with scl enable or scl_source. The article has a lot of advice on working with multiple versions of Python on RHEL, which should hopefully help people avoid running into problems. Note: There are other non-Red Hat rpms that will create a /usr/bin/python3 without clobbering /usr/bin/python but those aren't supported by Red Hat.
🌐
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 - Share · Sort by: Best · Open ... Python 3.6. The package is not installed by default. To install Python 3.6, use the yum install python3 command....
🌐
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 - Installing Python 3.11 on RHEL 8 server Here are the steps to install Python 3.11.3 on a RHEL 8 system: 1. Update the System Packages: sudo dnf update 2. Install Development Tools: sudo dnf …
🌐
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
docs.redhat.com › en › documentation › red_hat_enterprise_linux › 8 › html › configuring_basic_system_settings › installing-and-using-dynamic-programming-languages_configuring-basic-system-settings
Chapter 16. Installing and using dynamic programming languages | Configuring basic system settings | Red Hat Enterprise Linux | 8 | Red Hat Documentation
You can install Python 3.11 and Python 3.12, including packages built for each version, in parallel on the same system, with the exception of the mod_wsgi module. Due to a limitation of the Apache HTTP Server, only one of the python3.11-mod_wsgi or python3.12-mod_wsgi packages can be installed on a system.
🌐
Greenwebpage
greenwebpage.com › home › blog › how to install python on red hat enterprise linux 9
How to Install Python on Red Hat Enterprise Linux 9 - Greenwebpage Community
March 30, 2024 - Install Python (version 3.11) on Red Hat Enterprise Linux 9 through a few commands. After running the update command, execute “sudo dnf install python3.11” to set up the Python files on your system.
🌐
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
October 25, 2019 - make altinstall #Example Output: /usr/bin/install -c -m 644 ./Misc/python.man \ /usr/local/share/man/man1/python3.12.1 if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--altinstall --upgrade" ;; \ install|*) ensurepip="--altinstall" ;; \ esac; \ ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Looking in links: /tmp/tmpx72ujmtm Processing /tmp/tmpx72ujmtm/pip-23.2.1-py3-none-any.whl Installing collected packages: pip Successfully installed pip-23.2.1
🌐
LinuxTechi
linuxtechi.com › home › how to › how to install python 3 on rhel 9 (red hat enterprise linux)
How to Install Python 3 on RHEL 9 (Red Hat Enterprise Linux)
August 19, 2024 - $ ./configure --enable-optimizations $ sudo make altinstall $ sudo cp /usr/local/bin/python3.12 /usr/bin/ $ sudo cp /usr/local/bin/pip3.12 /usr/bin/ After the successful installation, verify the python version, run
🌐
Act-Show Linux
linuxactionshow.com › home › about linux › installing python 3 on rhel 7: a comprehensive guide
Install Python 3 on RHEL 7: A Guide
September 22, 2023 - sudo yum install python3 · Verify the successful installation of Python 3; python3 –version It should display the installed Python 3.x version. Building Python 3.8 from source offers greater control and customization.
🌐
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.