You should have taken the default available python3, that is the python3.6 package in centos7 that would have been easier to setup rather than compile an unsupported version. Suggest you install the supported python3 package in centos

Try doing yum install python36 from repository

sudo yum install -y https://repo.ius.io/ius-release-el7.rpm

Update yum package

 sudo yum update

Install python36 along with pip

sudo yum install -y python36u python36u-libs python36u-devel python36u-pip

Below steps are for python3.7, suggest avoiding unsupported packages. Alternate Steps for pip setup for Centos You need to install pip for python3.7 series Step 1: First install the EPEL Repository

sudo yum install epel-release

Step 2: Installing pip

python37 -m pip

Step 3: Verify if pip was installed properly pip --version

If the command not found error shows up, try

python37 -m ensurepip
Answer from Magnus Melwin on Stack Overflow
🌐
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 this tutorial, we are going to take a look at how to get up and running with Python 3 on a CentOS 7 server. Specifically, we will take a look at how to install Python 3 via the CentOS 7 package manager Yum as well as from source.
🌐
AlexHost
alexhost.com › home › faq › comprehensive guide to installing python 3 on centos 7
Comprehensive Guide to Installing Python 3 on CentOS 7
October 7, 2024 - To access it, enable the EPEL (Extra Packages for Enterprise Linux) repository: ... The EPEL repository contains additional packages, including Python 3, that are not found in standard CentOS repositories.
Discussions

python - How to install pip specifically for Python3 on CentOS 7? - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... CentOS 7 already has Python2.7.5 stock installed. I am doing an online course that requires Python3.x installed. More on stackoverflow.com
🌐 stackoverflow.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
Cleanest way to install Python 3.7 on CentOS 7 image
Have you considered usinh the official Python 3.7 Docker image ? More on reddit.com
🌐 r/docker
7
1
July 10, 2019
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
People also ask

How to install Python pip on CentOS 7?
Install `pip` for Python 3: `sudo yum install python3-pip`
🌐
monovm.com
monovm.com › blog › centos › how to install python 3 on centos 7?
How to Install Python 3 on CentOS 7?
How to change Python 2 to Python 3 on CentOS 7?
CentOS 7 typically has Python 2 as the default. To use Python 3, explicitly call `python3` instead of `python` for commands, or consider adjusting symbolic links. Use `sudo alternatives --config python` to change the default Python version if alternatives are installed.
🌐
monovm.com
monovm.com › blog › centos › how to install python 3 on centos 7?
How to Install Python 3 on CentOS 7?
🌐
1Gbits
1gbits.com › home page › blog › server software & tools › how to install python 3 on centos 7
How to Install Python 3 on CentOS 7
May 9, 2026 - Update the system environment · yum update –y · Once the system is updated, we can go ahead with the Python 3 installation. Run the following command. yum install –y python3 ·
🌐
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 - 5. Once in the Python directory, compile the source code into an installation package with the following two commands: ... The make command builds the installer package. The altinstall command instructs the system to create a second installation of this version of Python. Without it, the system would replace the default version of Python. 6. Check the Python version to verify the installation: ... This guide provided two different ways on how to install Python 3 on CentOS 7.
Top answer
1 of 3
6

You should have taken the default available python3, that is the python3.6 package in centos7 that would have been easier to setup rather than compile an unsupported version. Suggest you install the supported python3 package in centos

Try doing yum install python36 from repository

sudo yum install -y https://repo.ius.io/ius-release-el7.rpm

Update yum package

 sudo yum update

Install python36 along with pip

sudo yum install -y python36u python36u-libs python36u-devel python36u-pip

Below steps are for python3.7, suggest avoiding unsupported packages. Alternate Steps for pip setup for Centos You need to install pip for python3.7 series Step 1: First install the EPEL Repository

sudo yum install epel-release

Step 2: Installing pip

python37 -m pip

Step 3: Verify if pip was installed properly pip --version

If the command not found error shows up, try

python37 -m ensurepip
2 of 3
1

I also as you said "followed these steps religiously from this link: https://tecadmin.net/install-python-3-7-on-centos/."

It was not an option for me to install python3.6, as I explicitly needed 3.7. I was able to install using the following procedure:

# AFAIK, libffi-devel solved the "ModuleNotFoundError: No module named '_ctypes'" I had when I tried installing without it. 
yum install libffi-devel 

cd /usr/src
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
tar xzf Python-3.7.5.tgz
cd Python-3.7.5
./configure --enable-optimizations
make install  # Or: make altinstall
python3 -V
pip3 --version
rm -f /usr/src/Python-3.7.5.tgz

What I changed from the referenced article is the version (3.7.5 instead of 3.7.4) and in addition installed "libffi-devel". It could be that this one would have solved on 3.7.4 as well.

🌐
Linuxize
linuxize.com › home › python › how to install python 3 on centos 7
How to Install Python 3 on CentOS 7 | Linuxize
October 15, 2019 - This tutorial will guide you through installing Python 3 on a CentOS 7 system using the Software Collections (SCL) along side the distribution default Python …
Find elsewhere
🌐
Linux Hint
linuxhint.com › install_python3_centos7
Install Python 3 on CentOS 7 – Linux Hint
Now install yum-utils package with the following command: ... Now press y and then press <Enter> to continue. ... Now press y and then press <Enter> to continue. IUS package repository should be added. Now update the yum package repository cache again with the following command: ... The yum package repository cache should be updated. Now you’re ready to install Python 3.x.
🌐
Wsldp
elearning.wsldp.com › pcmagazine › install-python-3-centos-7
How to Install Python 3 on CentOS 7 - e learning
In This Tutorial We are going discuss How to Install python3 on CentOS 7 Linux. To Install Python3 we can use epel release or we can compile and install from the source.
🌐
MonoVM
monovm.com › blog › centos › how to install python 3 on centos 7?
How to Install Python 3 on CentOS 7?
January 15, 2024 - 1- Update Package Repository: Ensure your system has the latest information about available packages. ... 2- Install Python 3: Use the following command to Install Python 3.6 CentOS 7, the package is named `python3`.
🌐
Vinod Pandey
vinodpandey.com › how-to-install-python3-on-centos-7
How to Install Python 3 on Centos 7 | Vinod Pandey
January 10, 2021 - In this tutorial we will install Python 3.6, 3.7, 3.8 & 3.9 on CentOS 7. The default python version in CentOS 7 is 2.7.5. If we forcefully upgrade or replace this version, yum and other utitiles may break causing the OS to become unstable. Instead of upgrading/replacing default python, we will install the new version of python using alternate install method. This setup will also install corresponding pip for each python version separately. ... python3.9 -V Python 3.9.1 pip3.9 -V pip 20.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9
🌐
CyberITHub
cyberithub.com › install-python3
How to install Python3 on CentOS 7 | CyberITHub
October 9, 2019 - [root@localhost ~]# yum install python3 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.excellmedia.net * extras: centos.excellmedia.net * updates: centos.excellmedia.net Resolving Dependencies --> Running ...
🌐
AZDIGI
azdigi.com › home › blog › linux server › install python 3 and set it as the default on centos 7
Install Python 3 and set it as the default on Centos 7 with 5 steps
January 13, 2026 - So now my VPS is using Python version 2.7. So to upgrade to Python 3 version, go to step 3. ... yum -y update (Cập nhật yum) yum -y install yum-utils (Cài đặt yum utils) yum -y groupinstall development (cài đặt các công cụ phát ...
🌐
Reddit
reddit.com › r/centos › trying to install python3.9 on centos 7
r/CentOS on Reddit: Trying to install python3.9 on CentOS 7
October 19, 2022 -

I've tried a few didnt online guides but nothing seems to be helping me achieve what I'm looking for. I have a Linux machine for my network environment that I use for automation. I'm trying to upgrade my python 3.6.8 to some version of 3.9.x. I want to remove python 3.6.8, install 3.9, and then put 3.9 as the default for every user on the box.

Current Version of Linux 3.10.0-1160.6.1.el7.x86_64

I'm not a linux pro but I know some things.

🌐
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 - Compile the source code into an Installation package using the next two commands once you’re in the Python directory: ./configure --enable-optimizations · make altinstall · The installation package is created using the make program. The system is told to build a second installation of this version of Python by the altinstall command. Without it, the system would use Python instead of the default version. python3.9 · The system will display as below : You may easily install Python 3 on your CentOS 7 PC by following these instructions.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7
How To Install Python 3 and Set Up a Local Programming Environment on CentOS 7 | DigitalOcean
April 20, 2017 - This tutorial will guide you through installing Python 3 on your local CentOS 7 machine and setting up a programming environment via the command line. Python…
🌐
GitHub
gist.github.com › wpupru › deda1cd96ea242d9a790e50cd0c97e9f
Install Python 3.7.0 on Centos 7 · GitHub
It went well in my case. Hope it helps ... sudo su yum install -y wget gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel ; cd /usr/src; wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz ; tar xzf Python-3.7.0.tgz ; cd Python-3.7.0 ; ./configure --enable-optimizations ; make altinstall ; rm -rf /usr/bin/python3 ; ln -s /usr/local/bin/python3.7 /usr/bin/python3 ; python3 -V uname -a · Sign up for free to join this conversation on GitHub.
🌐
Medium
rakeshjain-devops.medium.com › how-to-install-python-3-on-centos-7-7-using-yum-and-source-and-set-as-default-1dee13396f7
How to Install Python 3 on CentOS 7.7 using yum/source and set as Default | by Rakesh Jain | Medium
October 13, 2020 - [root@centos7 ~]# alternatives --install /usr/bin/python python /usr/bin/python2 50[root@centos7 ~]# alternatives --install /usr/bin/python python /usr/bin/python3.6 60[root@centos7 ~]# alternatives --config python · In order to ensure that Python 3 is in fact installed and useable, we can drop into a Python 3 shell by running the following command. [root@centos7 ~]# python Python 3.6.8 (default, Aug 7 2019, 17:28:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information.
🌐
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.
🌐
Server Fault
serverfault.com › questions › 978812 › how-to-install-python3-using-yum-epel-release-on-centos7
linux - how-to install python3 using yum/epel-release on centos7 - Server Fault
# yum install python36 Failed to set locale, defaulting to C Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.copahost.com * epel: epel.besthosting.ua * extras: centos.intergenia.de * updates: ftp.halifax.rwth-aachen.de No package python36 available. Error: Nothing to do · Could you please advise how to install python36 using yum ? ... RHEL/CentOS 7 now includes python3 (version 3.6) in the base repositories.
🌐
Medium
medium.com › @CurtisForrester › installing-python3-in-centos-7-6-offline-69d45ca48054
Installing Python3 in CentOS 7.6 Offline | by C.R.Forrester | Medium
August 1, 2019 - For this I simply spun up a Docker container based on CentOS 7.6. (https://hub.docker.com/_/centos). I then set it up with the necessary packages to build Python from source. Any CentOS 7.6 build environment will do. sh-4.2# yum install -y ...