环境介绍
系统:CentOS Linux release 7.9.2009 (Core)
架构:x86_64
待安装环境:python3.11.8
开始安装
安装openssl
依赖openssl1.1.1,要不然import _ssl会报错 No module named '_ssl'
wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz
tar xf openssl-1.1.1w.tar.gz
ls
./config --prefix=/usr/local/openssl --libdir=lib --openssldir=/etc/pki/tls
cd openssl-1.1.1w
./config --prefix=/usr/local/openssl --libdir=lib --openssldir=/etc/pki/tls
make -j1 depend
make -j8
make install_sw
/usr/local/openssl/bin/openssl version
安装python
wget https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tar.xz
tar xf Python-3.11.8.tar.xz
cd Python-3.11.8
./configure -C --with-openssl=/usr/local/openssl --with-openssl-rpath=auto --prefix=/data/Python-3.11.8
make -j8
make altinstall