系统环境: CentOS7.6
系统状态: 关闭selinux、firewalld
安装依赖包:[root@rhel7 Python-3.8.0]# yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel libffi-devel
(重启)
删除原有的python2.7
[root@rhel7 user1]# rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps
[root@rhel7 user1]# whereis python|xargs rm -frv
一、下载python3.8版本
[root@rhel7 Python-3.8.0]# wget http://npm.taobao.org/mirrors/python/3.8.0/Python-3.8.0.tgz
二、解压
[root@rhel7 Python-3.8.0]# tar -xzf Python-3.8.0.tgz
三、进入解压后的目录并预设值
[root@rhel7 Python-3.8.0]# ./configure --prefix=/usr/local/python3.8
四、编译并安装
[root@rhel7 Python-3.8.0]# make && make install
来源:oschina
链接:https://my.oschina.net/u/4346143/blog/4567086