LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Removing/switching python versions (https://www.linuxquestions.org/questions/linux-software-2/removing-switching-python-versions-912756/)

vvenomouss 11-09-2011 11:38 PM

Removing/switching python versions
 
I am on CentOS 5, my server already has python 2.4 installed. I installed Activestate Python 2.7, the installation was successful and all went good.

But even now python -V would display 2.4

How do I remove 2.4 or how can I switch between the versions? Or any other suggestions?

EricTRA 11-10-2011 12:15 AM

Hello,

You've marked your thread as solved. Could you please let the community know how you fixed your problem so that others in a similar situation can see if it works for them too? I'm assuming you found update-alternatives as a solution. Thanks in advance. Off the Zero Reply List.

Kind regards,

Eric

vvenomouss 11-10-2011 12:25 AM

Solution:

I added the new python installation to that path overwriting the previous version, as such the new version became default.

export PATH=/usr/bin/Python2.7/bin:$PATH

Thanks

EricTRA 11-10-2011 12:30 AM

Hello,

Thank you for providing the info. But, what about the programs that depend on the previous version of Python? Wouldn't it be 'cleaner' to install both versions next to one another and use for example update-alternatives? Or use python2.7 as a link to the newer version in your programs? At least you know that when strange things happen on your server where to start looking :).

Kind regards,

Eric

vvenomouss 11-10-2011 01:24 AM

Yeah you are right, I had also done:

alias python='/usr/bin/Python2.7/bin/python'

So applications should run smoothly. Are you talking about backward compatibility? Apps that can't run on 2.7?


All times are GMT -5. The time now is 11:15 AM.