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
๐ŸŒ
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
Discussions

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
Cleanest way to install Python 3.7 on CentOS 7 image
Have you considered usinh the official Python 3.7 Docker image ? More on google.com
๐ŸŒ google.com
7
1
July 10, 2019
Ansible, Python3 and package management with CentOS/RHEL - some advice needed

To avoid this type of issue, we use pip/pip3 for ansible/boto installation. It works across *nix OS flavors, and works well in containers that are a bit more difficult like alpine.

More on reddit.com
๐ŸŒ r/ansible
7
1
October 31, 2018
Python 3.8 not possible to install on Linux? Why?
It's nearly 2020 already, can we please move forward please. RHEL/Centos has a 6 years release cycle with 10 years maintenance support. Every package needs to work with every other package across the entire system... for the entire time. You cannot update any package without verifying first that you are not breaking anything in the process, and that takes resources, like time from people that knows what they are doing. And python 3.6 end-of-life is on 2021-12-23, we still have two years of full support. Besides... Why do you want to have python 3.8 system-wide? If you install a different version of a library as fundamental as python at a system level you are risking breaking packages or libraries on the whole system. I wonder what new feature is so necessary from python 3.8 that python 3.6 doesn't have that is so pressing for you to have it on your system immediately. I'm not sure what the deal is with Python enthusiasts or RHEL/CentOS users that someone somewhere has not simply updated some repo somewhere, I can try and get involved. Please do it, get involved. Learn. Fix. Document. Share. But a word of warning: tune it down a bit before going full-on whining again anywhere on both communities. More on reddit.com
๐ŸŒ r/Python
8
0
October 15, 2019
๐ŸŒ
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
๐ŸŒ
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.
๐ŸŒ
Readthedocs
fire-insights.readthedocs.io โ€บ en โ€บ latest โ€บ installation โ€บ python-install-linux.html
Python Installation on Linux - Redhat/CentOS โ€” Sparkflows 0.0.1 documentation
Python modules in Fire Insights use Python 3.7+. ... Python installation requires the GCC compiler to be available on the machine. Use the following command to install the prerequisites for installing Python. yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
Find elsewhere
๐ŸŒ
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).
๐ŸŒ
Web3us
web3us.com โ€บ how-guides โ€บ how-upgrade-python-371-fedora-or-centos
How to upgrade to python 3.7.1 on Fedora or Centos | Web3us LLC
January 19, 2019 - sudo yum -y install gcc gcc-c++ sudo yum -y install zlib zlib-devel sudo yum -y install libffi-devel ยท Download Python using the following command from python official site. You can also download the latest version in place of specified below. cd /usr/src wget https://www.python.org/ftp/p...
๐ŸŒ
Google
google.com โ€บ goto
Installing Python3 in CentOS 7.6 Offline | by C.R.Forrester | Medium
August 1, 2019 - While there will be a better way to bundle Python 3.7.4 (or just wait for the CentOS 8 release), this method allowed me to proceed with development and testing tasks. 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 epel-release sh-4.2# yum install -y gcc openssl-devel bzip2-devel libffi libffi-devel make wget
๐ŸŒ
Google
google.com โ€บ goto
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
google.com โ€บ goto
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.