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
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
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 ...
๐ŸŒ
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, ...
๐ŸŒ
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 ...
๐ŸŒ
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
๐ŸŒ
Red Hat
docs.redhat.com โ€บ en โ€บ documentation โ€บ red_hat_enterprise_linux โ€บ 10 โ€บ html โ€บ installing_and_using_dynamic_programming_languages โ€บ installing-and-using-python
Chapter 1. Installing and using Python | Installing and using dynamic programming languages | Red Hat Enterprise Linux | 10 | Red Hat Documentation
To use these packages, you must have the python* packages installed. To select the appropriate environment for developing and running your applications, review Python versions available in Red Hat Enterprise Linux (RHEL) 10. Python 3.12 is the default Python implementation in RHEL 10. Python 3.12 is distributed in a non-modular python3 RPM package in the BaseOS repository and is usually installed by default.
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 - 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.
๐ŸŒ
UnixArena
unixarena.com โ€บ 2018 โ€บ 05 โ€บ how-to-install-python-3-on-redhat-enterprise-linux-7-x.html
How to Install Python 3 on Redhat Enterprise Linux 7.x ? - UnixArena
October 13, 2024 - [root@uaans ~]# yum install -y python36u python36u-pip Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register.
๐ŸŒ
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 - 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
๐ŸŒ
LinuxConfig
linuxconfig.org โ€บ home โ€บ install python 3 on redhat 8
Install python 3 on Redhat 8
January 7, 2020 - How to to check Python version on Redhat 8. Python 3 installation on Red Hat Enterprise Linux 8. To install Python 3 on Red Hat Enterprise Linux 8 execute the following dnf command: # dnf install python3 ยท Use --version option to check the ...
๐ŸŒ
Red Hat
developers.redhat.com โ€บ blog โ€บ 2018 โ€บ 11 โ€บ 14 โ€บ python-in-rhel-8-3
Python in RHEL 8 | Red Hat Developer
February 22, 2024 - To install Python, type `yum install python3`. To run Python, type `python3`. What you need to know for using Python in RHEL 8
๐ŸŒ
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
๐ŸŒ
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
Once configure is complete, compile Python by running make. Finally, install Python 3 on your system by running make install. ... What tools do you mean? python3, pip etc comes with the interpreter.
๐ŸŒ
Red Hat
access.redhat.com โ€บ solutions โ€บ 4321271
How to install Python 3.X on Red Hat Enterprise Linux 7 with Red Hat Software Collections? - Red Hat Customer Portal
September 8, 2024 - How to install Python 3.X on Red Hat Enterprise Linux 7? Can we install Python 3.X on Red Hat Enterprise Linux 7?
๐ŸŒ
TecMint
tecmint.com โ€บ home โ€บ redhat โ€บ how to install python 3 or python 2 in rhel 8
How to Install Python 3 or Python 2 in RHEL 8
July 5, 2019 - To install Python 3 on your system, use the DNF package manager as shown. ... From the output of the command, Python3.6 is the default version which comes with PIP and Setuptools as dependencies.
๐ŸŒ
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.