🌐
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 - Learn how to install or upgrade Python on CentOS 7 and CentOS 8 Stream. Step-by-step guide to building the latest Python version from source, installing dependencies, and safely updating Python on a server.
🌐
DevOpsSchool.com
devopsschool.com › blog › installing-python-3-on-linux-centos-ubuntu-windows
Python Tutorials: Installing Python 3 on Linux, Centos, Ubuntu & Windows
Python 3.9.6 is the latest version available in the CentOS 8 repos. The EOL of Python 3.9.6 is Oct 2026, so you can use that version. To install it, just run yum install python39 and that’s it.
Discussions

centos - Upgrade python without breaking yum - Stack Overflow
I recently installed Python 2.7.3 on a CentOS machine by compiling from source. Python 2.7.3 is installed at /opt/python2.7 and when I installed it I just changed /usr/bin/python to point to the new More on stackoverflow.com
🌐 stackoverflow.com
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 cd /opt sudo wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz sudo tar xzf Python-3.8.12.tgz cd Python-3.8.12 sudo ./configure --enable-optimizations sudo make install · I thought make install would create python3 ... More on stackoverflow.com
🌐 stackoverflow.com
How to upgrade Python 3 on Linux RHEL? - Stack Overflow
Currently I have a need or Rhel ... that are CentOS that also need the same python upgrade.. ... Below command worked for me. ... Sign up to request clarification or add additional context in comments. ... Sharing what worked for me. Worked for me on Enterprise RHEL 7. #-> python --version Python 2.7.5 #-> yum install rh-python38 #-> scl enable rh-python38 bash #-> python --version Python 3.8.... More on stackoverflow.com
🌐 stackoverflow.com
Python Versions on CentOs 7
Going to iuscommunty is unnecessary. CentOS 7.7 includes a python3 package in the base repository Regardless it sounds like you installed pip3 from an RPM then tried to update it natively? Don’t do that (with anything), you’re bound to just make a mess as other packages depend on having a certain version installed. I use pip only as a last resort; in general I try to find RPMs for the Python packages I want, mostly from CentOS repositories or EPEL. More on reddit.com
🌐 r/CentOS
15
2
December 23, 2019
🌐
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 - Install any updated version python on centOS 7/8 [Simple way] Example 3.8 1. Update System, installing wget and dependencies sudo yum -y update sudo yum -y install wget sudo yum install -y gcc …
🌐
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 or CentOS 8 and Ubuntu 18.04 or Ubuntu 20.04.
🌐
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 ...
🌐
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 - Table of Contents Toggle · Install ... Before you do anything, you need to update Centos, do this with the following command: yum -y update ·...
🌐
VMware
docs.vmware.com › en › VMware-vSphere-Bitfusion › 4.0 › Example-Guide › GUID-D3A136D1-0EA1-4CD0-AFCF-7FD88299A53A.html
How to install Python on CentOS and Red Hat Linux
August 25, 2022 - Ubuntu comes preinstalled with Python 3. Update all currently installed packages by running the yum update command. sudo yum update · To install Python 3, run the dnf command. sudo dnf install python3 · (Optional) To verify that you are using Python 3, run the the python3 -V command. python3 ...
🌐
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 - 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.
🌐
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 - 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. If you want to install Python 3.10 or 3.11, follow the tutorial below.
Find elsewhere
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to install latest version of python 3 on centos 7
How to Install Latest Version Of Python 3 on CentOS 7
November 10, 2022 - If you are using a CentOS release older than 7.7, you need to add IUS, a yum repository that provides newer software versions and includes Python 3. ... Wait for the installation to complete.
🌐
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 - [root@centos7 ~]# yum install gcc openssl-devel bzip2-devel libffi-devel -y · Next, we need to grab the version of Python we want. The following command will pull down the latest stable version of Python 3.8 as of the writing of this article.
🌐
ComputingForGeeks
computingforgeeks.com › home › install python 3.13 on rhel 10 / rocky linux 10 / almalinux 10
Install Python 3.8 on CentOS 7 / CentOS 8 | ComputingForGeeks
September 17, 2023 - As of this article update, the ... the packages required for Python installation. sudo yum -y install epel-release sudo yum -y update...
Top answer
1 of 10
147

I have written a quick guide on how to install the latest versions of Python 2 and Python 3 on CentOS 6 and CentOS 7. It currently covers Python 2.7.13 and Python 3.6.0:

# Start by making sure your system is up-to-date:
yum update
# Compilers and related tools:
yum groupinstall -y "development tools"
# Libraries needed during compilation to enable all features of Python:
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel
# If you are on a clean "minimal" install of CentOS you also need the wget tool:
yum install -y wget

The next steps depend on the version of Python you're installing.

For Python 2.7.14:

wget http://python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz
tar xf Python-2.7.14.tar.xz
cd Python-2.7.14
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall

# Strip the Python 2.7 binary:
strip /usr/local/lib/libpython2.7.so.1.0

For Python 3.6.3:

wget http://python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
tar xf Python-3.6.3.tar.xz
cd Python-3.6.3
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall

# Strip the Python 3.6 binary:
strip /usr/local/lib/libpython3.6m.so.1.0

To install Pip:

# First get the script:
wget https://bootstrap.pypa.io/get-pip.py

# Then execute it using Python 2.7 and/or Python 3.6:
python2.7 get-pip.py
python3.6 get-pip.py

# With pip installed you can now do things like this:
pip2.7 install [packagename]
pip2.7 install --upgrade [packagename]
pip2.7 uninstall [packagename]

You are not supposed to change the system version of Python because it will break the system (as you found out). Installing other versions works fine as long as you leave the original system version alone. This can be accomplished by using a custom prefix (for example /usr/local) when running configure, and using make altinstall (instead of the normal make install) when installing your build of Python.

Having multiple versions of Python available is usually not a big problem as long as you remember to type the full name including the version number (for example "python2.7" or "pip2.7"). If you do all your Python work from a virtualenv the versioning is handled for you, so make sure you install and use virtualenv!

2 of 10
14
vim `which yum`
modify #/usr/bin/python to #/usr/bin/python2.4
🌐
GitConnected
levelup.gitconnected.com › how-to-install-python-3-8-on-rhel-8-and-centos-8-fac11aef2165
How to Install Python 3.8 on RHEL 8 and CentOS 8 | by Amit Kumar Manjhi | Level Up Coding
November 8, 2022 - The standard repository for RHEL 8.0 provides Python 3.8. It can be installed using the dnf or yum command. ... Press the Y key to accept the download and installation. ... Note: If you cannot find the command to check the version, I mean it ...
🌐
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.
🌐
Linode
linode.com › docs › guides › how-to-install-python-on-centos-8
How to Install Python 3 on CentOS 8 | Linode Docs
February 12, 2021 - You need to build Python 3.9 from source to install it on CentOS 8. ... sudo dnf groupinstall 'development tools' sudo dnf install wget openssl-devel bzip2-devel libffi-devel ... If you have an already existing Python binary installed at ...
🌐
Reddit
reddit.com › r/centos › python versions on centos 7
Python Versions on CentOs 7 : r/CentOS
December 23, 2019 - Good to know CentOS 8 has Python 3 pre-installed. ... You can use SCL repository (yum install centos-release-scl) then install Python3 using it, for example Python 3.6: yum install rh-python36