1.安装依赖环境
yum -y install wget gcc make zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
2.安装libressl2.74
wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.4.tar.gz --no-check-certificate
tar zxvf libressl-2.7.4.tar.gz
cd libressl-2.7.4
./configure --prefix=/usr/local/libressl274
make
make install
在.bash_profile增加以下代码
export LDFLAGS="-L/usr/local/libressl274/lib"
export CPPFLAGS="-I/usr/local/libressl274/include -I/usr/local/libressl274/include/openssl"
export PKG_CONFIG_PATH=”/usr/local/libressl274/lib/pkgconfig”
export LD_LIBRARY_PATH="/usr/local/libressl274/lib:$LD_LIBRARY_PATH"
export PATH="/usr/ocal/python37/bin:$PATH"
然后source .bash_profile
在/etc/ld.so.conf.d 目录下新建一个文件libressl274.conf
内容为
/usr/local/libressl274/lib
保存后执行
ldconfig -v
3.下载python源码包
wget https://www.python.org/ftp/python/3.7.8/Python-3.7.8.tgz
4.编译安装python3.7
tar zxvf Python-3.7.8.tgz
cd Python-3.7.8
./configure prefix=/usr/ocal/python37
make
make install