准备环境
]# yum -y install zlib zlib-devel openssl openssl-devel readline readline-devel
确保以上的包都已经安装
下载Python-2.7.13.tar.xz
]# wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
解压Python-2.7.13.tar.xz
]# tar -Jxvf Python-2.7.13.tar.xz
]# cd Python-2.7.13
]# ./configure --prefix=/usr/local/python
]# make && make install
至此Python-2.7.13已经安装完毕
为方便调用,将其链接到/usr/local/bin目录下
]# ln -sv /usr/local/python/bin/python2 /usr/local/bin/python2.7.13
现在直接在终端键入python2.7.13即可使用新安装的python