1、首先查看当前python版本
[root@test bin]# python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
2、查看/usr/bin目录下的python版本
[root@test admin]# cd /usr/bin/
[root@test bin]# ll
3、删除/usr/bin目录下的python
rm -rf /usr/bin/python
4、新增python2.7的软连接
ln -s /usr/bin/python2.7 /usr/bin/python
5、查看python版本
[root@test bin]# python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>