When a package's exact name is not known (python3, python38, something scl) file name searches can do a more complete search: yum provides '*bin/python3*'

Correct, there is no python3.8 in EPEL 7. There is a python3.6 in EL 7, and EPEL policy is not to replace EL packages. Plus the distro's policy to avoid major upgrades, would seem like it is stuck on older Python.

Your yum repo list hints that CentOS software collections are enabled, which could be an alternative.

yum install centos-release-scl-rh
yum install rh-python38-python

Note both the package name and the files are prefixed, which allows coexistence with other pythons. While perhaps SCL is not the most popular packaging convention, it is already built and public, an advantage over your own source builds.

Currently CentOS 7 is 87 weeks from end of life, which is not a lot by EL time scales. Most of the maintainer attention is on EL 8 and 9, 7 is critical fixes only.

Budget some of that time to figure out what you are are going to do post CentOS 7. Which may be non-trivial, as CentOS 8 is dead, and if Stream is not what you need, may be switching distros.

Answer from John Mahowald on serverfault.com
🌐
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 - $ sudo subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms $ yum group install "Development Tools" In Red Hat Enterprise Linux 8, Python 3 is distributed in versions 3.6 (default), 3.8, and 3.9, provided by the python36, python38, and python39 modules, which can be installed in parallel as well.
🌐
Biyondbytes
biyondbytes.com › post › How-to-Install-Python-38-Using-Yum
How to Install Python 3.8 Using Yum - Step-by-Step Guide | Biyond Bytes
sudo yum install python38 -y · python3.8 --version · //output Python 3.8.X //you should get this in your terminal · sudo alternatives --set python /usr/bin/python3.8 · This code will set Python 3.8 version default.
Discussions

linux - How to install python 3.8 directly in /usr/bin? - Stack Overflow
Trying to install python 3.8 from source in CentOS 7.9. The default installed python is 2.7.5 and is located at /usr/bin. sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel sudo... More on stackoverflow.com
🌐 stackoverflow.com
Installing Python 3 on RHEL - Stack Overflow
[root@453fc5c55104 /]# yum install python38 Installed: python38-3.8.0-6.module+el8.2.0+5978+503155c0.x86_64 python38-libs-3.8.0-6.module+el8.2.0+5978+503155c0.x86_64 python38-pip-19.2.3-5.module+el8.2.0+5979+f9f0b1d2.noarch python38-pip-wheel-19.2.3-5.module+el8.2.0+5979+f9f0b1d2.noarch ... More on stackoverflow.com
🌐 stackoverflow.com
python - Python38 packages on Fedora 31 yum - Unix & Linux Stack Exchange
repo id repo name status *fedora ... 139 # yum search python38 Last metadata expiration check: 0:01:40 ago on Thu 26 Nov 2020 05:10:27 PM UTC. ======================= Name Exactly Matched: python38 ======================= python38.x86_64 : Version 3.8 of the Python interpreter python38.i686 : Version 3.8 of the Python interpreter python38.x86_64 : Version 3.8 of the Python interpreter ... On Fedora, Python 3 packages other than the interpreter are prefixed python3-; thus dnf install ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
November 22, 2021
I made a huge mistake by removing python..
yum history list all then: yum history rollback [ID] More on reddit.com
🌐 r/redhat
38
17
October 2, 2020
🌐
Oracle Linux
yum.oracle.com › oracle-linux-python.html
Python for Oracle Linux | Oracle, Software. Hardware. Complete.
To install Python 3.8 from the SCL on Oracle Linux 7, install oracle-softwarecollection-release-el7 and then install scl-utils and rh-python38: $ sudo yum install -y oracle-softwarecollection-release-el7 $ sudo yum -y install scl-utils rh-python38
🌐
Cloudera
docs.cloudera.com › cdp-private-cloud-base › 7.1.9 › installation › topics › cdpdc-cm-install-python-3-rhel8-standard-location.html
Installing Python 3.8 standard package on RHEL 8
July 19, 2024 - Python 3 is distributed in versions ... Python 2.7. SSH into the host system as a root user. Install Python 3.8 by running the following command: yum install python38 ·...
🌐
LinuxTut
linuxtut.com › en › 592483c7625e881d771f
Install Python 3.8 on CentOS 7 (SCL)
June 24, 2020 - # cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core) # yum install -y rh-python38 which # scl enable rh-python38 bash ...Abbreviation
🌐
CentOS Repositories
centos.pkgs.org › 7 › centos-sclo-rh-x86_64 › rh-python38-python-3.8.0-15.el7.x86_64.rpm.html
rh-python38-python-3.8.0-15.el7.x86_64.rpm CentOS 7 Download
Install rh-python38-python rpm package: # yum install rh-python38-python · 2020-04-28 - Charalampos Stratakis <cstratak@redhat.com> - 3.8.0-15 - Add a sentinel value on the Hmac_members table of the fips compliant hmac module Resolves: rhbz#1817494 · 2020-04-27 - Charalampos Stratakis ...
🌐
Installati.one
installati.one › home › centos › 8th › how to install python38 on centos 8
How To Install python38 on CentOS 8 | Installati.one
August 1, 2021 - Packages containing additional libraries for Python are generally named with the “python38-” prefix. For the unversioned “python” executable, see manual page “unversioned-python”. We can use yum or dnf to install python38 on CentOS 8.
Find elsewhere
🌐
Server World
server-world.info › en › note
CentOS 7 : Install Python 3.8 : Server World
Install NVIDIA Graphic Driver · Configure Local Yum Mirror · Check Network Bandwidth · Mount with SSHFS · Display Hardware Info · Configure RAID 1 · Set Disk Quota · Display HDD Info · Add Hard Drive · Create SSL Certificates (Self Sign) Get SSL Certificates (Let's Encrypt) Reset root Password ·
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 › 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
$ python3.12 $ python3.12 -m venv --help $ python3.12 -m pip install package $ pip3.12 install package · System administrators can configure the unversioned python command, located at /usr/bin/python, by using the alternatives command. Note that the required package, python3, python38, python39, python3.11, python3.12, must be installed before configuring the unversioned command to the respective version.
🌐
Snapcraft
snapcraft.io › install › python38 › rhel
Install python38 on Red Hat Enterprise Linux using the Snap Store | Snapcraft
November 18, 2019 - sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" sudo yum update Copy to clipboard ... Once installed, the systemd unit that manages the main snap communication socket needs to be enabled:
🌐
TecAdmin
tecadmin.net › install-python-3-8-centos
How To Install Python 3.8 on RHEL/CentOS 7 & Fedora 34 ...
April 26, 2025 - Use the following command to install prerequisites for Python before installing it. sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
🌐
Eldernode
blog.eldernode.com › tutorial install python 3.8 on centos/rhel 8 linux
Tutorial Install Python 3.8 on Centos/RHEL 8 Linux
September 4, 2024 - sudo dnf install gcc openssl-devel bzip2-devel libffi-devel · Before you do anything, you need to update Centos, do this with the following command: yum -y update · You can download Python from its official site using the following command. cd /opt wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz ·
🌐
Snapcraft
snapcraft.io › install › python38 › centos
Install python38 on CentOS using the Snap Store | Snapcraft
November 18, 2019 - sudo yum install snapd · Once ... are updated correctly. To install python38, simply use the following command: sudo snap install python38 ·...
🌐
ComputingForGeeks
computingforgeeks.com › home › install python 3.13 on rhel 10 / rocky linux 10 / almalinux 10
Install Python 3.13 on Rocky Linux / AlmaLinux [2 Methods]
March 24, 2026 - CentOS Install Deno on RHEL 10 ... 7 CentOS How to Install LAMP Stack on RHEL 10 | CentOS Stream 10 ... sudo yum install -y xz-devel cd Python-3.8*/ ./configure –enable-optimizations sudo make altinstall Repl...
🌐
Stack Exchange
unix.stackexchange.com › questions › 621689 › python38-packages-on-fedora-31-yum
python - Python38 packages on Fedora 31 yum - Unix & Linux Stack Exchange
November 22, 2021 - repo id repo name status *fedora ... 139 # yum search python38 Last metadata expiration check: 0:01:40 ago on Thu 26 Nov 2020 05:10:27 PM UTC. ======================= Name Exactly Matched: python38 ======================= python38.x86_64 : Version 3.8 of the Python interpreter python38.i686 : Version 3.8 of the Python interpreter python38.x86_64 : Version 3.8 of the Python interpreter ... On Fedora, Python 3 packages other than the interpreter are prefixed python3-; thus dnf install ...
🌐
Red Hat
docs.redhat.com › es › documentation › red_hat_enterprise_linux › 8 › html › configuring_basic_system_settings › installing-and-using-python_using-python3
15.2. Instalación y uso de Python | Configuración de los ajustes básicos del sistema | Red Hat Enterprise Linux | 8 | Red Hat Documentation
Para instalar Python 3.8 desde el módulo python38, utilice: # yum install python38 · El flujo del módulo python38:3.8 se activa automáticamente. Para obtener detalles sobre los módulos en RHEL 8, consulte Instalación, gestión y eliminación de componentes del espacio de usuario.