注:该博客转载至PengYunjing博客,加以改动。
#0x01 安装依赖环境
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
#0x02 获取python3.7.1
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
#0x03 创建目录
mkdir /usr/local/python3
#0x04 解压并进入安装目录
tar -zxvf Python-3.7..tgz
cd Python-3.7.
#0x05 安装
./configure --prefix=/usr/local/python3
make && make install
#0x06 创建软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
#0x07 测试
python3 -V
pip3 -V
完成✅