赞
踩
[windcf@localhost ~]$ uname -a
Linux localhost.localdomain 4.19.90-52.22.v2207.ky10.x86_64 #1 SMP Tue Mar 14 12:19:10 CST 2023 x86_64 x86_64 x86_64 GNU/Linux
yum install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel lzma-devel lzma gdbm-devel gdbm xz-devel gcc make -y
编译安装3.8由于openssl版本(1.1.1f)问题,_ssl模块编译失败。需要修改openssl版本,以1.1.1g为例。
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar -xzvf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g/
./config --prefix=/usr/local/openssl
make -j $nproc
sudo make install
make install
# openssl lib
export LD_LIBRARY_PATH=/usr/local/openssl/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
wget https://www.python.org/ftp/python/3.8.18/Python-3.8.18.tgz
tar -xzvf Python-3.8.18.tgz
cd Python-3.8.18
# 编译安装
./configure --prefix=/user/local/python3.8 --with-openssl=/usr/local/openssl --enable-optimizations
make -j$nproc
make altinstall
# 建立软链接
ln -s /usr/bin/python3.8 /usr/local/python3.8/bin/python3.8
ln -s /usr/bin/pip3.8 /usr/local/python3.8/bin/pip3.8
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。