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 - 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 with RHEL 9 and continues with RHEL 8 and RHEL 7, including plenty of tips useful in all versions.
Discussions

rhel - How to install python3 with all it is tools on Redhat RHEL7 offline machine - Unix & Linux Stack Exchange
I have a Django project that is going to be installed in an RHEL 7 server with no internet access. I need to include everything locally, starting from python3 source, to pip and setup tools. with every package that the system may need to run python, I have added tons and tons of packages, but ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
Why did Red Hat take so long to adopt Python3 for Rhel distributions?
RedHat is an enterprise OS. They're not supposed to move fast, like at all, because of necessary legacy support. More on reddit.com
🌐 r/redhat
11
14
April 12, 2018
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
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. 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.

More on reddit.com
🌐 r/rhel
2
3
August 13, 2018
🌐
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 - Python 3 is distributed in versions 3.6, 3.8, and 3.9, provided by the python36, python38, and python39 modules on RHEL 7. CDP requires that you install Python version 3.8 on your cluster hosts.
🌐
IBM
ibm.com › support › pages › work-around-frustrating-python-3-install-rhel7
Work-around the frustrating Python 3 install on RHEL7
For reasons I cannot fathom, it is very hard to install Python version 3 on RHEL7 - here is my work-around. and reminder for myself. It seems I am not alone on this annoying RHEL 7 missing feature, so I thought I would share the solution.
🌐
Readthedocs
fire-insights.readthedocs.io › en › latest › installation › python-install-linux.html
Python Installation on Linux - Redhat/CentOS — Sparkflows 0.0.1 documentation
Use the following command to install the prerequisites for installing Python. yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel ... source venv/bin/activate pip freeze > requirements.txt pip uninstall -r requirements.txt -y deactivate rm -r venv/ yum install https://dl.fedo...
Find elsewhere
🌐
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
Answer: Q: How do I install Python 3 with all its tools on a Red Hat RHEL7 offline machine? Use an online machine to download all of the required rpm packages from Red Hat’s repository. You can also use CentOS’s repository as the software is pretty much the same.
🌐
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
Installing Python packages with pip as the root user places files in system locations. This can override RHEL libraries and might cause system instability or conflicts with supported packages. Red Hat does not support software installed by using pip at the system level.
🌐
GitHub
gist.github.com › avryhof › 9ad49343cb8b58622fc710958d299af5
Install Python 3.8 on RHEL7 · GitHub
Install Python 3.8 on RHEL7 · Raw · rhel7-python-38.sh · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
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 - 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.
🌐
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 - Learn two efficient methods to install Python 3 on RHEL 7, ensuring compatibility with modern applications.
🌐
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 - Upgrade python 2 in RHEL 8, run: sudo yum upgrade python2 · Let us see all commands and example in details. Try any one of the following syntax along with grep command: sudo yum search python3 | more sudo yum search python2 | more sudo yum search python36 sudo yum search python2 | grep 'python2.x86_64' You can show detailed information before installing package as well: sudo yum info python2.x86_6 sudo yum info python36
🌐
Django
djangoproject.com › download
Download Django | Django
PyCharm is the Python IDE for Professional Developers by JetBrains providing a complete set of tools for productive Python, Web and scientific development. ... Kraken is the most-loved operating system for energy. Powered by our Utility-Grade AI™ and deep industry know-how, we help utilities transform their technology and operations so they can lead the energy transition. Delivering better outcomes from generation through distribution to supply, Kraken powers 70+ million accounts worldwide, and is on a mission to make a big, green dent in the universe.
🌐
HashiCorp Developer
developer.hashicorp.com › terraform › tutorials › aws › install
Install Terraform | Terraform | HashiCorp Developer
Install yum-config-manager to manage your repositories. ... Use yum-config-manager to add the official HashiCorp RHEL repository.
🌐
Astral
docs.astral.sh › uv › concepts › python-versions
Python versions | uv
March 18, 2026 - If a .venv directory is found in the working directory or any of the parent directories or the VIRTUAL_ENV environment variable is set, it will take precedence over any Python executables on the PATH. To ignore virtual environments, use the --system flag: ... Managed Python installations in the UV_PYTHON_INSTALL_DIR.
🌐
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
February 16, 2026 - At this point, we'll walk via the installation step by step and provide detailed tutorial with commands and descriptions of each step. If your system does not have the "wget" module, execute the commands one after the other: ... We get the latest version from the Python.org website.
🌐
GitHub
github.com › pyenv › pyenv
GitHub - pyenv/pyenv: Simple Python version management · GitHub
Depend on Python itself. pyenv was made from pure shell scripts. There is no bootstrap problem of Python. Need to be loaded into your shell. Instead, pyenv's shim approach works by adding a directory to your PATH. Manage virtualenv. Of course, you can create virtualenv yourself, or pyenv-virtualenv to automate the process. ... The Homebrew option from the MacOS section below would also work if you have Homebrew installed.
Starred by 44.9K users
Forked by 3.3K users
Languages   Shell 86.1% | Python 11.6% | Makefile 1.5% | C 0.3% | Roff 0.3% | Dockerfile 0.2%
🌐
jashealthy
jashealthy.weebly.com › blog › install-python-rhel-7
Install python rhel 7 - jashealthy
June 4, 2023 - IUS is a community project and it provides Red Hat Package Manager packages for some newer version of select software, so it can provide the necessary RPM packages, such as: Python3. Method1:...