问题描述
- CentOS安装python2.7.9,竟然自己指向了/usr/local/bin,求原因
-
在CentOS下安装python2.7.9,(下面会粘出操作history),本来以为按照网上说的,需要在/usr/bin下面改名字,做软链接什么的,发现竟然不用,请大神们解答这是一种什么机制。命令行里输python,人家就是2.7.9版本了:
[fy@VM_70_40_centos bin]$ python
Python 2.7.9 (default, Mar 16 2016, 20:55:54)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.然后which,人家自己就指向python2.7.9的安装路径了
[fy@VM_70_40_centos bin]$ which python
/usr/local/bin/python进到/usr/bin目录下查看,依旧是python2.6.6版本
[root@VM_70_40_centos bin]# ./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()
附:安装python的history
70 2016-03-16 20:41:52 wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
71 2016-03-16 20:48:41 ls
72 2016-03-16 20:51:22 xz -d Python-2.7.9.tar.xz
73 2016-03-16 20:51:25 LS
74 2016-03-16 20:51:26 ls
75 2016-03-16 20:51:43 tar -xf Python-2.7.9.tar
76 2016-03-16 20:51:48 ls
77 2016-03-16 20:52:12 cd Python-2.7.9/
78 2016-03-16 20:52:14 ls
79 2016-03-16 20:52:19 vim README
80 2016-03-16 20:54:49 ./configure
81 2016-03-16 20:55:13 make
82 2016-03-16 20:56:41 echo $?
83 2016-03-16 20:56:51 make install
84 2016-03-16 20:57:05 echo $?
85 2016-03-16 20:57:08 ls
解决方案
http://www.cnblogs.com/dudu/p/4294238.html
解决方案二:
这应该是你configure的默认安装路径就是usr local中