Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
367 views
in Technique[技术] by (71.8m points)

linux - Change default Python version from 2.4 to 2.6

I'm wanting to use some newer software that requires Python 2.6, and we currently have both 2.4 and 2.6 installed on our dedicated CentOS server, which looks like this:

$ which python
/usr/local/bin/python
$ which python2.6
/usr/bin/python2.6
$ which python2.4
/usr/local/bin/python2.4
$ ls -l /usr/local/bin/py*
-rwxr-xr-x 1 root root      81 Aug  9  2007 /usr/local/bin/pydoc
-rwxr-xr-x 2 root root 3394082 Aug  9  2007 /usr/local/bin/python
-rwxr-xr-x 2 root root 3394082 Aug  9  2007 /usr/local/bin/python2.4

How can I switch it to start using 2.6 as the default python?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As root:

ln -sf /usr/bin/python2.6 /usr/local/bin/python

This will make a symbolic link from /usr/local/bin/python --> /usr/bin/python2.6 (replacing the old hardlink).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...