今天在使用pip安装某软件的时候,遇到报错安装失败,经过查阅相关资料发现centos6.5系统自带的python版本过低,需要升级到python2.7以上,本文为升级流程笔记;
##系统信息:
[root@centos6 ~]# python -V
Python 2.6.6
[root@centos6 ~]# uname -a
Linux centos6.5-1 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
##升级步骤:
####下载python2.7.3
$ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
####解压编译安装
$ tar zxvf Python-2.7.3.tgz
$ cd Python-2.7.3
$ ./configure --prefix=/usr/local/python273
$ make && make install
####备份python2.6
$ mv /usr/bin/python /usr/bin/python-old
$ ln -s /usr/local/python273/bin/python /usr/bin/
#解决yum依赖
$ vi /usr/bin/yum
$ !/usr/bin/python --> #!/usr/bin/python-old
centos6.5系统自带python2.6升级到python2.7
原文地址:http://blog.51cto.com/wuyunkeji/2113606