1

I want Python 2.5, not 3.0.

Can I use yum update for this?

Daniel Serodio
  • 249
  • 3
  • 10
Alex
  • 8,111
  • 24
  • 71
  • 99
  • http://stackoverflow.com/questions/8722803/multiple-python-versions-using-virtualenv-p-and-virtualenvwrapper-win-on-wind and http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv – scape Apr 09 '13 at 15:32

5 Answers5

4

Your system python is on 2.4.3 because that's what all the applications in your distro is tested with. You don't want to upgrade or replace that version.

Install Python 2.5 from source instead. I'd recommend keeping it well out of /usr, and installing it in /opt/python25 or something, and running it from there for your custom apps. If you want to install it in /usr or /usr/local, install it with make altinstall so you the python command continues to be python2.4.

Lennart Regebro
  • 315
  • 1
  • 10
  • What if one of my applications requires python 2.4? – Alex Nov 03 '09 at 22:05
  • Then it will be fine, since Python 2.4 will still be the default Python on your system if you follow Lennart's instructions. –  Nov 03 '09 at 22:14
  • 1
    Then you run it with Python 2.4. There is no problem with having multiple versions of Python installed. – Lennart Regebro Nov 03 '09 at 22:14
1

You can't upgrade Python with yum - because yum runs in Python, and it will break itself (I've done this, and it sucked).

You need to install either from a stand-alone .rpm or from source.

warren
  • 17,829
  • 23
  • 82
  • 134
1

Don't upgrade the default Python installed with your distro and preferably, don't even use it except for sysadmin tasks that will run on that one box. Instead, build your own Python and install it in either your home directory, or perhaps into /python25 or /python26.

An easy way to do this is to go to this Activestate page and download the binary tarball AS package for your system and architecture. Once you untar this, there is a shell script to run which installs it into the directory of your choice.

I generally name the binary either apy25 or py25 so that I never get confused between the two or more Pythons installed. You might want to link the binary into your /usr/bin and edit your .bashrc as well.

Michael Dillon
  • 1,809
  • 13
  • 16
0

If you are happy with python 2.6 then there are well maintained packages available in the EPEL repository. The steps involved would be (as root, or with sudo):

rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install python26

There are quite a few python 2.6 packages in EPEL, you can see the list by doing:

yum search python26

A key advantage of this is that you will get bug fix updates for python 2.6 through yum, along with all your other updates.

(I'm assuming you are on CentOS 5 if python 2.4 is the packaged version).

Hamish Downer
  • 9,142
  • 6
  • 36
  • 49
0

install-python-2-5-on-redhat-centos

That was the second hit when I googled the subject line

gnibbler
  • 129
  • 3