1.安装必备插件依赖
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 gcc
2.下载Python3.6
2.1 新建一个python下载文件夹
mkdir /wensheng/download/python
2.2 进入上面的目录
cd /wensheng/download/python
2.3 在download文件夹下下载安装包
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
2.4 解压下载好的文件
tar -xvf Python-3.8.1.tgz
3.编译
3.1 创建安装文件路径
mkdir /wensheng/install/python
3.2 进入安装包中
cd /wensheng/download/python/Python-3.8.1
3.3 编译
./configure --prefix=/wensheng/install/python/python3
4.安装
4.1 进入安装包中
cd /wensheng/download/python/Python-3.8.1
4.2 安装,依次执行以下命令
make
make altinstall
5.生成软连接
ln -s /wensheng/install/python/python3/bin/python3.8 /usr/bin/python3.8
6.进入python交互界面
python3.8
7.安装pip
sudo yum -y install python3-pip