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)

🌐
Liquid Web
liquidweb.com › home › how to install python 3 on centos 7
Install Python 3 on CentOS 7: Easy Steps for Linux Users | Liquid Web
April 7, 2025 - In order to install Python 3 from source, we are going to need to ensure that some prerequisite packages are installed on our system. [root@centos7 ~]# yum install gcc openssl-devel bzip2-devel libffi-devel -y
Discussions

Installing python on CentOS - Unix & Linux Stack Exchange
I am unable to digest the fact that Linux CentOS requires users to do so much just for installing Python. It was so easy installing python on Ubuntu. Also since CentOS comes with python2.5 it lead... More on unix.stackexchange.com
🌐 unix.stackexchange.com
Trying to install python3.9 on CentOS 7
Just curious, why are you sticking with CentOS 7 instead of upgrading to CentOS Stream 9, Rocky Linux 9, RedHat EL 9 or Alma 9? More on reddit.com
🌐 r/CentOS
7
10
October 19, 2022
Problem installing Python 3.9 RPM with yum on Centos 7
Is there a reason why you didn't start with the python3 SRPM in CentOS? More on reddit.com
🌐 r/linuxquestions
4
1
January 17, 2023
Python 3.8 not possible to install on Linux? Why?
It's nearly 2020 already, can we please move forward please. RHEL/Centos has a 6 years release cycle with 10 years maintenance support. Every package needs to work with every other package across the entire system... for the entire time. You cannot update any package without verifying first that you are not breaking anything in the process, and that takes resources, like time from people that knows what they are doing. And python 3.6 end-of-life is on 2021-12-23, we still have two years of full support. Besides... Why do you want to have python 3.8 system-wide? If you install a different version of a library as fundamental as python at a system level you are risking breaking packages or libraries on the whole system. I wonder what new feature is so necessary from python 3.8 that python 3.6 doesn't have that is so pressing for you to have it on your system immediately. I'm not sure what the deal is with Python enthusiasts or RHEL/CentOS users that someone somewhere has not simply updated some repo somewhere, I can try and get involved. Please do it, get involved. Learn. Fix. Document. Share. But a word of warning: tune it down a bit before going full-on whining again anywhere on both communities. More on reddit.com
🌐 r/Python
8
0
October 15, 2019
🌐
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 ...
🌐
Serverspace
serverspace.io › support › help › install-python-centos
How to Install or Upgrade Python on CentOS 7/8 Stream: Build the Latest Python from Source
April 9, 2025 - In order to perform a Python version upgrade, a few new packages must be supplied in addition. Send commands to the terminal: yum groupinstall -y "Development Tools" --skip-broken · wget https://public-yum.oracle.com/public-yum-ol6.repo -O /etc/yum.repos.d/public-yum-ol6.repo ... sudo dnf install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
🌐
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 requires the GCC compiler to be available on the machine. Use the following command to install the prerequisites for installing Python. yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-install-python-on-linux
How to Install Python on Linux - GeeksforGeeks
July 12, 2025 - sudo apt install python3-dev python3-venv build-essential · This command will Fixe common permission issues with pip installations. ... This command Resolves package manager lock issues.
🌐
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
Find elsewhere
🌐
GitHub
gist.github.com › MichaelCurrin › 57d70f6aaba1b2b9f8a834ca5dd19a59
Install Python on Linux distros · GitHub
From the article on How to install Python3 on CentOS 7. $ sudo yum install centos-release-scl $ sudo yum install rh-python39 # i.e.
🌐
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-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 ...
🌐
DedicatedCore
dedicatedcore.com › home › how to install latest version of python 3.10 on centos 7
How to Install Latest Version of Python 3.10 on CentOS 7 - DedicatedCore Blog
May 29, 2025 - Before continuing with the installation on your CentOS system. You can move on to the following step if your CentOS installation is 7.7 or newer. You must add IUS, a yum repository that offers more recent software versions and contains Python 3 if you are using a CentOS version older than 7.7.
🌐
DevOpsSchool.com
devopsschool.com › home › python tutorials: installing python 3 on linux, centos, ubuntu & windows
Python Tutorials: Installing Python 3 on Linux, Centos, Ubuntu & Windows - DevOpsSchool.com
August 7, 2023 - If you want to install Python 3.10 or 3.11, follow the tutorial below. $ sudo yum install yum-utils $ sudo yum-builddep python3 $ python3 --version
🌐
Python Packaging
packaging.python.org › guides › installing-using-linux-tools
Installing pip/setuptools/wheel with Linux Package Managers — Python Packaging User Guide
Enable the IUS repository and install one of the parallel-installable Pythons, along with pip, setuptools, and wheel, which are kept fairly up to date. ... Recent Debian/Ubuntu versions have modified pip to use the “User Scheme” by default, which is a significant behavior change that can be surprising to some users. ... Currently, there is no “copr” yum ...
🌐
Unihost
unihost.com › help › how to install python 3
How to Install Python 3 - Unihost.FAQ
February 23, 2023 - This guide will walk you through how to install the most recent version of Python 3 on CentOS 7 and Ubuntu 18.04 or Ubuntu 20.04. Before you begin, refresh the package listings. This helps ensure that yum is up to date.
🌐
InMotion Hosting
inmotionhosting.com › inmotion hosting home › support › server technologies › linux › how to install python 3.9 on centos 7
How to Install Python 3.9 on CentOS 7 | InMotion Hosting
March 21, 2025 - Before installing Python you will first need to install the requisite software packages using the following command: sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
🌐
CodeRivers
coderivers.org › blog › yum-install-python
Yum Install Python: A Comprehensive Guide - CodeRivers
April 19, 2025 - This blog will walk you through the fundamental concepts, usage methods, common practices, and best practices of using yum to install Python. ... Yum is a front-end to RPM (Red Hat Package Manager). It simplifies the process of installing, updating, and removing software packages on Linux systems.
🌐
Victordomingos
no-title.victordomingos.com › articles › 2020 › install_python_centos_linux › index.html
How to install the current Python version on CentOS Linux 7 | The No Title® Tech Blog
April 26, 2020 - Python misses something. You find out which development package provides that dependency. You install it using a package manager (for CentOS 7, it’s yum, but for other versions or other Linux distributions it could be dnf, apt-get or even other package managers).
🌐
Linux Stans
linuxstans.com › how-to-install-python-centos
How to Install Python 3.10 (or 3.11) on CentOS - Linux Stans
January 24, 2022 - Python 3.9.6 is the latest version available in the CentOS 8 repos. The EOL of Python 3.9.6 is Oct 2025, so you can use that version. To install it, just run yum install python39 and that’s it.
🌐
Medium
medium.com › @mrx04programmer › installing-any-updated-version-of-python-on-centos-7-8-or-arch-linux-563cabc8bb3c
Install any updated version python on centOS 7/8 | by mrx04programmer | Medium
August 16, 2023 - sudo yum -y update sudo yum -y install wget sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel · wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz