1.安装Python3所需要的依赖:
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
2.下载最新Python安装包,选择正确的版本,获取链接,使用wget下载:
https://www.python.org/downloads/release/python-365/
3.下载下来的Python包为:
Python-3.6.5.tgz
4.解压Python包:
tar -zxvf Python-3.6.5.tgz
5.最后的结果为:
[root@LeeCookiesECS ~]# ls
Python-3.6.5 Python-3.6.5.tgz train_list.txt update.txt
6.把Python-3.6.5移到/usr/local下面:
mv Python-3.6.5 /usr/local
7.进入python目录:
cd /usr/local/Python-3.6.5/
8.配置:
./configure
9.编译:
make
10.编译,安装:
make install
注意事项:
python安装包的名称会不一致,在执行命令的时候将包名改成最新的名称就可以