Are there any half-official repositories for CentOS 5 with Python 2.7?

EPEL provides only Python 2.6

6 Answers 6


I made an RPM for this a little while ago. You can find the source RPM here


Just do the usual rpmbuild --rebuild ... to create the binary rpms. It does not interfere with the installed 2.4 version, it coexists with it. but you do have to put the specific version in your scripts: #!/usr/bin/python2.7. But if you use setuptools invoked with that version then it happens automatically.


Have you checked any of these repos:

Is it ok if you have the rpm instead of a repo (i.e. can you take care of dependencies if it arises?). If so, try phone or rpmfind. If none of the above helps, consider building from source tar balls. By far that will be the easiest.

  • What do you mean by this By far that will be the easiest? What are you comparing it to?
    – tshepang
    Jul 9, 2011 at 16:58
  • @Tshepang, i comparing in terms of time needed/spent for fixing this type of typical case of dependency related issue. I am not saying about depency arasing out of this python package but the original dependency arised to get this particular version of python. I have faced this many times during my initial linux newbie days and have always at the end come to the conculsion that source tar ball is the fastest and hence the easiest way to solve this kind of problem. But that was years ago and now situation have vastly improved with automatic dependency resolution. But still work a try.
    – bagavadhar
    Jul 10, 2011 at 5:28
  • The IUS community project looked very promising. But it looks like they stopped efforts. Python 2.6 is the most recent there. iuscommunity.com. I still hope that one day the PSF will start sponsoring a Yum/PPA repo for RHEL/CentOS/Ubuntu.
    – Paidhi
    Mar 26, 2012 at 11:41

You can try to get 2.6 srpm from epel you've found, extract spec file from it, change version number and rebuild it.

However, be carefull: there are a lot of packages depending on python 2.4 on el5 (like yum). You'll probably need to ensure that you are installing 2.4 and 2.7 at the same time or that you've rebuild everything depending on 2.4.

  • 1
    I have successfully used python 2.6 together with 2.4 without problems. The only conflict was found with mod-wsgi -- it depends on python-dev, so you cannot use two mod-wsgi's simultaneously (I had to make a custom RPM for mod-wskg-python26)
    – grep
    Jul 11, 2011 at 10:32

Not that I am aware of. However, you can find .spec files on the net to build parallel python versions where all the RPM files are named python27-whatever etc. Then the default python executable is still your vendor one, which should not be changed or you may break very important things, like rpm itself (I speak from experience).

Note that starting with RHEL5 (I have no experience with 6), rpmbuild will "precompile" python in any RPM. It's a known bug that they refuse to fix that it will mess up the %files section. Anyway, the problem is that the files will be precompiled with the stock OS python, which is really annoying because then you get "Bad Magic Number" errors if you try to use them. You need to change some RPM config scripts, but I don't have the info in front of me.


You can try my build adapted from Fedora 16: http://ftp.srce.hr/redhat/test/el5/x86_64/


Not that I am aware of at this time, but then again it would be prudent to learn a standard gunzip make install instead of relying on package managers.

  • 1
    Being able to compile Python (and anything else) is a good skill. But installing anything this way in rpm-based distro is not a good idea. Building rpm - that is a good idea.
    – rvs
    Jul 9, 2011 at 18:20

You must log in to answer this question.

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