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 libffi-devel
2、下载包
https://www.python.org/ftp/python/3.8.1/
3、拷贝包
下载好 Python-3.8.1.tgz
这个包以后将这个安装包拷贝到linux的 /usr/local
目录下
我的Python-3.8.1.tgz
下载在我的window的 F:\asoft\linux\python\Python-3.8.1.tgz
下
所以我输入的命令是:cp /mnt/f/asoft/linux/python/Python-3.8.1.tgz /usr/local
4、解压:tar -zxvf Python-3.8.1.tgz
5、安装gcc用来构建yum install -y gcc
6、安装:cd Python-3.8.1
./configure --prefix=/usr/local/python3
make && make install
7、建立软连接ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
8、验证是否安装成功python3