Python 2.7 on CentOS 5

9,403

Solution 1

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

ftp://ftp.pycopia.org/pub/python/RHEL51/python2.7-2.7.1-1TH.src.rpm

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.

Solution 2

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.

Share:
9,403

Related videos on Youtube

grep
Author by

grep

Updated on September 18, 2022

Comments

  • grep
    grep over 1 year

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

    EPEL provides only Python 2.6

  • tshepang
    tshepang almost 13 years
    What do you mean by this By far that will be the easiest? What are you comparing it to?
  • rvs
    rvs almost 13 years
    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.
  • bagavadhar
    bagavadhar almost 13 years
    @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.
  • grep
    grep almost 13 years
    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)
  • Paidhi
    Paidhi about 12 years
    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.