1.首先是要安装Python3所需要的依赖,使用语句:
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
2.到Python官网上下载最新的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.txt6.把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