🌐
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 ...
🌐
TecAdmin
tecadmin.net › install-python-3-7-on-centos
How To Install Python 3.7 on CentOS/RHEL 7 & Fedora 34 ...
April 26, 2025 - Use command python3.7 instead of just python. ... Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp ... Hi everyone! You MUST install the ‘xz-devel’ package for centos 7 before ./configure and make. This must be the sequence: yum install gcc openssl-devel bzip2-devel libffi-devel ...
🌐
TecAdmin
tecadmin.net › install-python-3-7-on-centos-8
How to Install Python 3.7 on CentOS/RHEL 8 – TecAdmin
April 26, 2025 - Reply · Gary on May 27, 2021 1:23 pm · You also need “make” in your dnf install command. Reply · Akhil on December 16, 2020 12:57 pm · Prerequisites: where is make command? Reply · Jerry C on October 9, 2021 8:28 am · sudo yum install make ...
🌐
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 - Verify this specific installation using: python3.11 --version. In addition, for installing the pip package installer, add on the -pip extension to the version of python being installed, for example: ... $ 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 available as Red Hat Software Collections packages.
🌐
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
🌐
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 - Install build tools sudo 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 libraries: libpython3.7m.so.1.0: ...
🌐
Medium
medium.com › @Ibraheemcisse › 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 - Next, I installed the required dependencies for Python 3.7 to ensure that all necessary libraries and packages were available for the installation process. yum install -y libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel
🌐
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 - Once again, I needed to install a few support packages using yum and then rebuild Python using configure and make: So, you can see a pattern here. 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).
Find elsewhere
🌐
Sina's Blog
sinafathi.com › 2019 › install-python-3-7-on-centos-with-all-dependencies
Install Python 3.7 on CentOS with all dependencies - Sina’s Blog
August 13, 2019 - $ sudo yum groupinstall -y "Development Tools" $ sudo yum install –y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel gdbm-devel ncurses-devel db4-devel wget · Now that we installed ...
🌐
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
🌐
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
🌐
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 - Be sure not to do a make install or system level stuff like yum will get grumpy. [root@fresh-1 ~]# tar -xzf Python-3.7.4.tgz [root@fresh-1 ~]# cd Python-3.7.4/ [root@fresh-1 ~]# make altinstall · Looking at the versions we see that both the original “python” and the new “python3.7” are correct:
🌐
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 - The command `scl` calls the script `/opt/rh/rh-python36/enable` which changes the shell environment variables. ... Do keep in mind that Python 3.6 is the default Python version only in this shell session. If you exit the session, and open a new one in the terminal, then the default version will be v2.7.5. This method of installing Python is the more difficult approach, and it will take a bit longer. An advantage to this is that you’ve got more control over it. Please keep in mind that Yum will not know that you’ve installed a software if you manually compiled the source code.
🌐
GitHub
gist.github.com › leosaa › 211bd0b9738bd27b46138510bd012f60
install python 3.7.0 on RHEL/Centos 6.9 - Gist - GitHub
PYTHON_VERSION=3.7.0 PYTHON_URL=https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz mkdir $HOME/opt LOCAL=$HOME/opt mkdir $HOME/tmp DL=$HOME/tmp yum install libffi-devel · cd ${DL} wget -c https://zlib.net/zlib...
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.

🌐
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 ~]# yum groupinstall -y "Development Tools" && yum install gcc openssl-devel bzip2-devel libffi-devel -y · [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
🌐
DevOpsSchool.com
devopsschool.com › blog › installing-python-3-on-linux-centos-ubuntu-windows
Python Tutorials: Installing Python 3 on Linux, Centos, Ubuntu & Windows
sudo yum -y install wget make gcc openssl-devel bzip2-devel cd /tmp/ wget https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz tar xzf Python-3.8.7.tgz cd Python-3.8.7 ./configure --enable-optimizations sudo make altinstall sudo ln -sfn ...
🌐
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
🌐
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.