yum install gcc c++ make
mkdir /usr/local/python27
cd Python-2.7.10/
./configure --prefix=/usr/local/python27
make
make install

mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python27/bin/python2.7 /usr/bin/python

python #终端输入测试查看版本

vim /usr/bin/yum
将 #!/usr/bin/python
改为#!/usr/bin/python2.6