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.

CentOS 5.4 comes with python 2.4 standard. Yum doesn't seem to know python 2.6. What is the best way to install python 2.6, so it will be available for scripts and Apache HTTPd without breaking anything else?

share|improve this question
add comment

4 Answers

up vote 3 down vote accepted

Last time I played with different versions of python (at least a couple of revisions back so this may have changed and on Debian so with other distros YMMV), when compiling and installing from source you can do make altinstall instead of make install. This creates just a pythonX.Y binary and does not touch any current python binary. This way you get he right version by running, say, python2.6 (or using #!/usr/bin/python2.6 at the head of a script) but if just python is specified the previous default is used. As the standard libraries are usually separated by version they should not conflict, though you may need to tweak your command and library search paths in some cases and some third party modules might need some alteration to install in the non-default place.

share|improve this answer
add comment

Download ActivePython Community Edition from: www.activestate.com enter image description here

share|improve this answer
    
ActivePython also provides modwsgi binaries on Linux: code.activestate.com/pypm/modwsgi-apache2.2 -- which is exactly what code.activestate.com uses. –  Sridhar Ratnakumar Dec 14 '10 at 22:11
add comment

Yes, replacing the standard Python 2.4 will cause all kinds of problems.

Others have already done the heavy lifting, though. Rather than making from source, grab http://mirrors.geekymedia.com/centos/geekymedia.repo and put it into /etc/yum.repos.d.

The RPMs in that repo are already setup to do parallel installs of Python 2.5 & 2.6. For example, yum install python25 with install /usr/bin/python25.

share|improve this answer
add comment

If it's not in the standard repos, you really have two choices. You can either find a repo that has it that you trust and add that to your repo list. Or, you can build it from source. I'd say compiling and building from source is probably the easiest in this case.

share|improve this answer
    
If you build it, download the tarball with wget. –  smci Dec 6 '12 at 22:11
add comment

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.