centOS change the default python path

1. find default python and new python path

[root@master Downloads]# which python
/usr/bin/python
[root@master Downloads]# which python2.7
/usr/local/bin/python2.7

2. remove default python and copy new python to new default python

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python

3. check python version

python -V

then my output is Python 2.7.5

Related posts:

This entry was posted in knowledge, python. Bookmark the permalink.