0
votes

I have installed python 2.7.5 on CentOS 6.4 which python 2.6 already installed.

Python2.7 is under /usr/local/bin and library configuration is correct as well.

I set alias in .bash_profile as

alias python='/usr/local/bin/python2.7'
PATH=$PATH:/usr/local/bin

However, I need to do source .bash_profile each time I logged in and it's pretty annoying. How can I change my default python version to python2.7.5?

Thanks

2

2 Answers

0
votes

Logout from desktop environment, then login. And it will work. (.bash_profile is not sourced when you login graphically.)

If that does not work put alias line to .bashrc.

-1
votes

Create a symbolic link python in /usr/bin and point it to /usr/local/bin/python2.7. Something like this should work:

ln -s /usr/local/bin/python2.7 /usr/bin/python

Make sure you have permissions to do that. Once done, hit python command and it should get you to python 2.7

Hope this helps.