Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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 setup.py 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/ld.so.conf.d/usrlib.conf && 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 libpython2.7.so 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 –  Anand Jeyahar 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 http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-1-1.ius.el5.noarch.rpm
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm
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

 
discard

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.