python-2.7.13(编译安装)
更新python至2.7以上:
检查python版本
[root@www git-2.13.0]# python -V
Python 2.4.3
安装gcc编译器
[root@www ~]# yum -y install gcc
下载python源码
[root@www ~]# wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
安装python依赖
[root@www ~]# yum -y install openssl openssl-devel
注:Ubuntu执行 apt-get install -y openssl libssl.dev
编译安装python2.7
[root@www ~]# tar -zxf Python-2.7.13.tgz
[root@www ~]# cd Python-2.7.13
[root@www ~]#./configure ./configure --prefix=/usr/local/python-2.7.13 --enable-optimizations
[root@www ~]# make all
[root@www ~]# make install
[root@www ~]# make clean
[root@www ~]# make distclean
更改python命令指向python2.7
[root@www Python-2.7.13]# mv /usr/bin/python /usr/bin/python2.4
[root@www Python-2.7.13]# ln -s /usr/local/python-2.7.13/bin/python2.7 usr/local/bin/python2.7
[root@www Python-2.7.13]# python2.7 -V
Python 2.7.13 #更新成功

浙公网安备 33010602011771号