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

What is the best way to install Python 2.7 on CentOS? All the tutorials I'm seeing are either using a third party management system or manually installing a separate binary to co-exist with Python 2.4. Why is 2.4 needed, and how can I seamlessly install 2.7?

share|improve this question
up vote 4 down vote accepted

I ended up going with Python 2.7 and took the following steps:

  1. Download the source
  2. Update gcc and other build tools.
  3. configure && make && make altinstall

For Django:

  1. Removed django from the original 2.4 site-packages directory.
  2. Reinstalled django using python2.7 install.

A longer and much more detailed version can be found here.

share|improve this answer
I had to add the following steps : echo /usr/local/lib >> /etc/ && ldconfig – yanjost May 20 '11 at 9:39
@yanjost: Where exactly did you have to add that step? – Josh K May 20 '11 at 11:03
after step 3, because could not be found – yanjost May 21 '11 at 14:38
@yanjost: Interesting, thanks! – Josh K May 21 '11 at 15:46
+1 for the blog post link – Software Mechanic Feb 1 '12 at 5:56

Python 2.4 incompatible with Pyhton 2.6. CentOS packages and a lot of core features depend on python.

how can I seamlessly install 2.6?

For (for x64 change i386 to x86_64):

rpm -ivh
rpm -ivh
yum clean all
yum install python26

Then disable epel and ius(set enabled=0 in /etc/yum.repos.d/ius.repo and /etc/yum.repos.d/epel.repo)

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.