Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I followed this tutorial http://paltman.com/2007/nov/15/getting-ssl-support-in-python-251/ and installed python 2.5. Now when I enter the python terminal it reads python 2.5 and not 2.6.

How do I remove python 2.5? So it reverts back to 2.6?

Python was 2.5 was installed by:

./configure
make
make install
share|improve this question

migrated from stackoverflow.com Aug 21 '10 at 8:28

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

I doubt your make install overwrote version 2.6, so unless it did this can be fixed by simply re-organizing your PATH variable

share|improve this answer
    
How do i go about doing that? –  Phil Aug 20 '10 at 22:50
    
@Phil: Step 1 -- Identify the OS you're working on. Step 2 -- Update your question with the name of your operating system. Step 3 -- Google for "PATH" settings and your OS name, and see what you get. Step 4 -- Ask Specific questions on superuser.com for how to update OS settings. –  S.Lott Aug 20 '10 at 22:53
    
This question would be better answered on superuser.com. I assume you're on linux? export PATH="/path/to/python/2.6:${PATH}" –  John Weldon Aug 20 '10 at 22:54
    
Yes, fedora. I just did a whereis python 2.6 and recieved a number of directores which one should I use? –  Phil Aug 20 '10 at 22:59
add comment

If you did ./configure without a --prefix, Python will have been installed in /usr/local by default, so you could remove it with:

rm /usr/local/bin/python

however that will leave behind all sorts of other Python-related files in /usr/local. If Python is the only thing you have installed into /usr/local, it'll be easy to wipe it all by removing /usr/local/bin/*, /usr/local/lib/* and /usr/local/include/*. Otherwise, you'd have to be careful to remove only the Python-related files. That's all part of the fun of the wonderful Unix “install everything into the same folders” strategy (and why you typically do want to specify a --prefix.)

share|improve this answer
add comment

When you type python into terminal it is looking for python in the search path ($PATH). I have a few different versions of python on my computer. If I type python in to terminal, the interpreter for python2.6 opens. If I run:

ls -l /usr/bin | grep "python"

I see this:

lrwxrwxrwx 1 root   root           9 2010-05-12 19:44 python -> python2.6

At least on my computer, the version found when I call python is called because that is what the symbolic link with the name "python" is linked to. I am guessing you will see something similar on yours, except the link will be pointed at python2.5. To fix this simply get rid of the current link and create a new link to the python2.6 file:

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

Of course, before you do that you should make sure that you have all the needed files (mainly, python2.5 and python2.6 should still be present in the /usr/bin directory). There is also the chance that your python files are not in /usr/bin. There is nothing wrong with having multiple versions of python. I have 2.5 (because I use it at work), 2.6, and 3 on mine. If I want to use something other than the defaultthen I just direct it to that one.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.