安装环境准备:
yum update -y
安装 gcc和make插件
yum install gcc gcc-c++
yum -y install gcc automake autoconf libtool make
yum groupinstall -y 'Development Tools'
yum install -y gcc openssl-devel bzip2-devel libffi-devel
下载和编译python
https://www.python.org/ftp/python/
wget https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
1.解压缩
tar -zxvf Python-3.9.7.tgz
2.用脚本检验整个编译环境
cd Python-3.9.7
./configure prefix=/usr/local/python3 --enable-optimizations
3.make命令编译安装
make && make install
4.修改环境变量
export PATH=$PATH:/usr/local/python3/bin/
5.安装PIP
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.9 get-pip.py
测试 #python -V
评论