Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

CentOS 5.x comes with python 2.4 preinstalled. I'd like to use a newer version, but I don't want to break anything.

How should I install a newer version without causing problems?

How can I force mod_python to use newer python, instead of 2.4 ?

share|improve this question
up vote 4 down vote accepted

Python 2.6 is available via EPEL. To enable EPEL for your box, just do a:

rpm -ivh

Then, to install Python 2.6:

yum install python26

there is also a mod_python from there too:

yum install python26-mod_python

To find additional packages: yum search python26

share|improve this answer
will it replace the system's version? I think this can break something. – monkey Aug 27 '11 at 18:22
No, it installs in parallel as python26. – Chad Feller Aug 27 '11 at 18:23
python26-mod_python will automatically replace mod_python ? – monkey Aug 27 '11 at 18:38
By default, according to the changelog, it sounds like it will only load if mod_python isn't already loaded. More details can be found here. So it sounds like you will have to either remove the old mod_python (yum remove mod_python), or prevent it from loading (edit /etc/httpd/conf.d/python.conf) to use python26-mod_python. – Chad Feller Aug 27 '11 at 18:53

You can compile python2.x with another user (i use py26 as username) by

tar xzvf Python-2.6.7.tgz
cd Python-2.6.7
./configure --prefix=$HOME/python
make install

then add $HOME/python/bin to $PATH, so python2.6 only used by py26 user

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.