CentOS/7/Python 3.14
< CentOS
Python 3.14 on CentOS 7
Dependencies
sudo yum groupinstall "Development Tools" -y
sudo yum install -y \
gcc \
gcc-c++ \
make \
wget \
openssl-devel \
bzip2-devel \
libffi-devel \
zlib-devel \
readline-devel \
sqlite-devel \
xz-devel \
tk-devel \
gdbm-devel \
ncurses-devel
Download
cd /usr/src sudo wget https://www.python.org/ftp/python/3.14.6/Python-3.14.6.tgz sudo tar xzf Python-3.14.6.tgz cd Python-3.14.6
Configure
sudo ./configure \
--enable-optimizations \
--with-ensurepip=install
Build
sudo make -j$(nproc)
Install
sudo make altinstall
Verify
python3.14 --version
Virtual Environment
python3.14 -m venv ~/py314 source ~/py314/bin/activate python --version pip --version
Python 3.14 with OpenSSL 3.x
yum groupinstall -y "Development Tools"
yum install -y \
perl \
perl-IPC-Cmd \
wget \
zlib-devel
Download OpenSSL
cd /usr/src wget https://www.openssl.org/source/openssl-3.5.1.tar.gz tar xf openssl-3.5.1.tar.gz cd openssl-3.5.1
Configure
./Configure \
--prefix=/opt/openssl-3 \
--openssldir=/opt/openssl-3 \
shared \
linux-x86_64
Build and Install
make -j$(nproc) make install
Verify:
/opt/openssl-3/bin/openssl version
Make OpenSSL Runtime Visible:
cat >/etc/ld.so.conf.d/openssl3.conf <<EOF /opt/openssl-3/lib64 EOF # refresh ldconfig # verify: ldconfig -p | grep ssl # expected: libssl.so.3 libcrypto.so.3
Step 3: Build Python 3.14 Against OpenSSL 3
cd /usr/src wget https://www.python.org/ftp/python/3.14.6/Python-3.14.6.tgz tar xf Python-3.14.6.tgz cd Python-3.14.6
Configure:
LDFLAGS="-Wl,-rpath,/opt/openssl-3/lib64" \
./configure \
--prefix=/opt/python3.14 \
--with-openssl=/opt/openssl-3 \
--enable-optimizations \
--with-ensurepip=install
Make
make -j$(nproc)
Install:
make install
Verify Python and SSL
/opt/python3.14/bin/python3.14 import ssl print(ssl.OPENSSL_VERSION) OpenSSL 3.5.x
Verify TLS Works:
/opt/python3.14/bin/python3.14 -c "
import ssl
import urllib.request
print(ssl.OPENSSL_VERSION)
print(urllib.request.urlopen('https://www.python.org').status)
"
Install requests:
/opt/python3.14/bin/pip3.14 install requests
Verify Your Corporate CA
#!/opt/python3.14/bin/python3.14
import ssl
import requests
print("OpenSSL:", ssl.OPENSSL_VERSION)
r = requests.get(
"https://artifactory.sandisk.com",
timeout=30
)
print(r.status_code)
Check Which CA Store Python Uses
import ssl print(ssl.get_default_verify_paths())
and
import certifi print(certifi.where())
Force Requests to use the OS trust store:
pip install truststore
import truststore truststore.inject_into_ssl()