centos6 安装python3

sudo -i
cd /usr/src
curl https://www.openssl.org/source/openssl-1.0.2o.tar.gz | tar xz
cd openssl-1.0.2o
./config shared --prefix=/usr/local/
sudo make
sudo make install

mkdir lib
cp ./*.{so,so.1.0.0,a,pc} ./lib

cd /usr/src
sudo wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz
sudo tar xzf Python-3.9.4.tgz
cd Python-3.9.4
./configure --with-openssl=/usr/src/openssl-1.0.2o --enable-optimizations
sudo make
sudo make altinstall

你可能感兴趣的:(centos6 安装python3)