源码安装python2.7

[root@server /]# tar -zxf Python-2.7.11.tgz

[root@server /]# cd Python-2.7.11

[root@server /]# ./configure && make && make install

[root@server usr]# /usr/local/bin/python

Python 2.7.11 (default, Jan  2 2017, 12:16:39) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> exit()

[root@server usr]# python

Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> 

>>> exit()

[root@server usr]# 

[root@server usr]# cd ..

[root@server /]# cp /usr/bin/python /usr/bin/python.bak.20170102

[root@server /]# 

[root@server /]# rm /usr/bin/python

rm: remove regular file `/usr/bin/python'? y

[root@server /]# 

[root@server /]# ln -s /usr/local/bin/python

python            python2.7         python2-config    

python2           python2.7-config  python-config     

[root@server /]# ln -s /usr/local/bin/python2.7 /usr/bin/python

[root@server /]# 

[root@server /]# python

Python 2.7.11 (default, Jan  2 2017, 12:16:39) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> 

>>> exit()




 本文转自 归来仍少年 51CTO博客,原文链接:http://blog.51cto.com/shaoniana/1888241
上一篇:react native命令行全局安装


下一篇:C/C++字符串string操作的全面总结(一)