Ok, here's what finally worked for me.

I think the key to success was updating LD_LIBRARY_PATH and PATH to include openssl as I went.

Install and build openssl.

OpenSSL 1.1.1d 10 Sep 2019

cloned openssl repo

Pulled out latest(?) 1.1 branch

git checkout OpenSSL_1_1_1d -b 1_1_1d

./config --prefix=/opt/openssl
make
make install

Add /opt/openssl/lib to your LD_LIBRARY_PATH env var

Add /opt/openssl/bin to your PATH

Install and build python-3.7.6

I installed with --prefix=/opt/python-3.7.6

./configure --prefix=/opt/python-3.7.6  --enable-optimizations --with-openssl=/opt/openssl
make
make install

Add /opt/python-3.7.6/lib to your LD_LIBRARY_PATH env var

Add /opt/python-3.7.6/bin to your PATH

Final Config

LD_LIBRARY_PATH=/opt/openssl/lib:/opt/python-3.7.6/lib:

PATH=/opt/openssl/bin:/opt/python-3.7.6/bin:/opt/idea/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

Answer from SRJ on Stack Overflow
🌐
Google Groups
groups.google.com › g › vfx-platform-discuss › c › D-rdtZJV4nI
Python 3.7 on CentOS 7 (and 8)
On the other hand, yeah CentOS plan for getting to Python 3.7 is still not known ! But I see attempts of the same happening when searched on Internet (https://tecadmin.net/install-python-3-7-on-centos/)
🌐
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 ...
🌐
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 - 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.
🌐
Readthedocs
fire-insights.readthedocs.io › en › latest › installation › python-install-linux.html
Python Installation on Linux - Redhat/CentOS — Sparkflows 0.0.1 documentation
Python is only needed if you need to use Python and the PySpark engine in Fire Insights. Python modules in Fire Insights use Python 3.7+. ... Python installation requires the GCC compiler to be available on the machine.
🌐
Reddit
reddit.com › r/centos › what's the recommended way to install python 3.6 on centos 7?
r/CentOS on Reddit: What's the recommended way to install Python 3.6 on CentOS 7?
April 29, 2021 -

I am super new to CentOS and coming from MacOS. I'm guessing yum is like brew. Anyway Python 3 is not there on yum, what's the best way to install it on CentOS 7. All I see are random blogs each with a different method on how to install Python 3. What would be the best way?

Find elsewhere
🌐
RoseHosting
rosehosting.com › home › how to install python 3.6.4 on centos 7
How to Install Python 3.6.4 on CentOS 7 | RoseHosting
December 12, 2022 - In this tutorial, we will show you two methods of installing Python version 3.6.4 on your CentOS 7 machine. The reason there are two methods is that Python 3.6.4 does not come by default in the built-in Yum repositories.
🌐
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 - 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.
🌐
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.
🌐
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.
🌐
Stack Exchange
unix.stackexchange.com › questions › 545148 › python-3-6-installation-on-centos-7
Python 3.6 installation on CentOS 7 - Unix & Linux Stack Exchange
Pre CentOS 7.7 there are other ways to get python 3.6 such as miniconda or conda, or compile from source, but if you can, just upgrade to 7.7 and you should be able to run "yum install python3"
🌐
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,...
🌐
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).
🌐
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.
🌐
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
Could you please advise how to install python36 using yum ? ... RHEL/CentOS 7 now includes python3 (version 3.6) in the base repositories.
🌐
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 - Upgrade your CentOS 7 server to Python 3 with ease using our step-by-step guide featuring Yum and install Python3 Linux instructions.
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)