安装依赖包
1、yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
2、yum install gcc gcc-c++
安装wget
3、yum install wget
下载源码包
4、wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz
解压安装
5、tar -zxvf Python-3.8.5.tgz
6、cd Python-3.8.5
7、./configure prefix=/usr/local/python3
8、make && make install
修改linux的PATH(出现问题可以考虑配置PATH,一般不配)
-
打印 PATH
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin -
添加到 /etc/profile