2

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?

2 Answers 2

4

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.

4
  • I had to add the following steps : echo /usr/local/lib >> /etc/ld.so.conf.d/usrlib.conf && ldconfig
    – yanjost
    May 20, 2011 at 9:39
  • @yanjost: Where exactly did you have to add that step?
    – Josh K
    May 20, 2011 at 11:03
  • after step 3, because libpython2.7.so could not be found
    – yanjost
    May 21, 2011 at 14:38
  • +1 for the blog post link Feb 1, 2012 at 5:56
2

Python 2.4 is incompatible with Python 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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .