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
🌐
GitHub
gist.github.com › wpupru › deda1cd96ea242d9a790e50cd0c97e9f
Install Python 3.7.0 on Centos 7 · GitHub
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.
🌐
TecAdmin
tecadmin.net › install-python-3-7-on-centos
How To Install Python 3.7 on CentOS/RHEL 7 & Fedora 34 ...
April 26, 2025 - I am getting the following error (similar to one above) when doing the make altinstall on centos 10 · changing mode of /usr/local/bin/idle3.7 to 755 rm /usr/local/lib/python3.7/lib-dynload/_sysconfigdata_m_linux_x86_64-linux-gnu.py rm -r /usr/local/lib/python3.7/lib-dynload/__pycache__ /usr/bin/install -c -m 644 ./Misc/python.man \ /usr/local/share/man/man1/python3.7.1 if test “xupgrade” != “xno” ; then \ case upgrade in \ upgrade) ensurepip=”–altinstall –upgrade” ;; \ install|*) ensurepip=”–altinstall” ;; \ esac; \ ./python -E -m ensurepip \ $ensurepip –root=/ ; \ fi
Discussions

python - How to install pip specifically for Python3 on CentOS 7? - Stack Overflow
Yes, but the problem is that running ... Python3.7.3rc1 gives error ModuleNotFoundError: No module named 'pyperclip' but works fine for Python2.7.5. ... I see. How about running pip3? Does it show something to you? ... No, bash: pip3: command not found.... ... Think you've done a lot of work for a beginner unnecessarily. Try installing the python36 package that's the default supported python3.x series in centos ... More on stackoverflow.com
🌐 stackoverflow.com
openssl - Going nuts: How to get python 3.7.6 installed on CentOS 7 - Stack Overflow
I have tried many ways of installing python3.7.6 on centos 7. Regardless of what I do, I always get the error that the SSL module is not available. I have tried basic install guides such as https:// More on stackoverflow.com
🌐 stackoverflow.com
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
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
🌐
Vinod Pandey
vinodpandey.com › how-to-install-python3-on-centos-7
How to Install Python 3 on Centos 7 | Vinod Pandey
January 10, 2021 - Introduction 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.
🌐
OS Radar
osradar.com › home › linux › install python 3.7 on centos 7 and fedora 27/28
Install Python 3.7 on centos 7 and Fedora 27/28 - Linux Windows and android Tutorials
October 4, 2018 - #cd /root #wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz ... Use below set of commands to compile Python source code on your system using altinstall. ... #make altinstall -------------------------------------------- -------------------------------------------------------- if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--altinstall --upgrade" ;; \ install|*) ensurepip="--altinstall" ;; \ esac; \ ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Looking in links: /tmp/tmpoolx9axs Collecting setuptools Collecting pip Installing collected packages: setuptools, pip Successfully installed pip-10.0.1 setuptools-39.0.1
🌐
DEV Community
dev.to › mkalioby › install-python-3-7-on-centos-7-3i7b
Install Python 3.7+ on CentOS 7 - DEV Community
December 2, 2021 - The how-to is on the internet but ... yum install gcc openssl-devel bzip2-devel libffi-devel · Download the source from https://www.python.org/downloads/source/ ... If you get /usr/local/bin/python3.7: error while loading shared ...
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.

🌐
Dracula Servers
draculaservers.com › home › how to install python 3.x on centos 7
How to Install Python 3.x on CentOS 7 - Dracula Servers Tutorials
November 14, 2021 - In this tutorial we'll install Python 3.6 and Python 3.7 on a server running Centos 7 using 2 methods - from repositories & compiling from source.
Find elsewhere
🌐
Reddit
reddit.com › r/docker › cleanest way to install python 3.7 on centos 7 image
r/docker on Reddit: Cleanest way to install Python 3.7 on CentOS 7 image
July 10, 2019 -

I would think CentOS + Python would be extremely common but I can't find an elegant way to do this.

These both work, but they take minutes to run and bloat the image:

method #1:

FROM centos:7
RUN yum update -y && yum -y install yum-utils && yum -y groupinstall development && yum -y install https://centos7.iuscommunity.org/ius-release.rpm
RUN yum install -y python36u

method #2:

FROM centos:7
RUN yum -y --enablerepo=extras install epel-release && yum clean all && yum -y update
RUN wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz && tar xzf Python-3.7.2.tgz
RUN cd Python-3.7.2 && ./configure --enable-optimizations && make altinstall
🌐
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.

🌐
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 …
🌐
Medium
medium.com › @info_37956 › setting-up-python-3-7-development-environment-on-centos-7-server-c488807049bd
Setting Up Python 3.7 Development Environment on CentOS 7 Server | by Ibrahim Cisse | Medium
March 15, 2024 - I recently embarked on a journey to set up a Python 3.7 development environment on my CentOS server. Here’s a recount of the steps I followed: ... I began by accessing my CentOS server via SSH. After successfully logging in, I switched to the root user to perform administrative tasks. ... With administrative privileges, I installed the necessary development tools using the yum groupinstall command.
🌐
Centmin Mod
community.centminmod.com › threads › custom-python-3-7-3-8-3-9-3-10-rpm-builds-for-centos-7.22456
CentOS 7.x - Custom Python 3.7, 3.8, 3.9 & 3.10 RPM Builds For CentOS 7 | Centmin Mod Community Support Forums
February 5, 2022 - CentOS 7 by default uses Python 2.7 and has side by side install support up to Python 3.6 via YUM repository RPM packages. For Python 3.7 and higher,...
🌐
Google Groups
groups.google.com › g › vfx-platform-discuss › c › D-rdtZJV4nI
Python 3.7 on CentOS 7 (and 8)
I'm currently working on adding support for Python 3.7 on Isotropix Clarisse.On Windows and macOS, the official Python installer is easy to download and use. But on CentOS 7, official Python binaries in repositories go up to 3.6, not 3.7.
🌐
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 - 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 Hint
linuxhint.com › install_python3_centos7
Install Python 3 on CentOS 7 – Linux Hint
In this article, I will show you how to install Python 3.x, mainly Python 3.4, Python 3.5, Python 3.6 along with PIP for Python 3.4, Python 3.5, and Python 3.6 respectively on CentOS 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 - In this tutorial, we’re going to show you how to install Python (the latest version) on CentOS with step-by-step instructions. This tutorial includes instructions for Python 3.10 and Python 3.11 on CentOS 7 and CentOS 8.
🌐
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 - Any CentOS 7.6 build environment will do. sh-4.2# yum install -y epel-release sh-4.2# yum install -y gcc openssl-devel bzip2-devel libffi libffi-devel make wget · Pull down the Python source for the version of choice — 3.7.4 currently.
🌐
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 install Python 3 on CentOS 7, you must first update your system, enable the EPEL repository, and then install the desired Python version.