Page 1 of 2

Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 08:09:48
by reetika
By default centos 5 has python 2.4. I want to install python 2.7 on cent os 5 Please help

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 09:40:43
by TrevorH
Could you use python 2.6 instead? Several repositories package python 2.6 in a way that allows for parallel installation - EPEL has a python26 package for example.

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 11:38:54
by reetika
No i need python 2.7 for my project

Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 22:44:47
by pschaff
Then your best bet is to start with the EPEL [url=http://download.fedora.redhat.com/pub/epel/5/SRPMS/python26-2.6.5-6.el5.src.rpm]python26-2.6.5-6.el5.src.rpm[/url] and use it as a guide to attempt to [url=http://wiki.centos.org/HowTos/RebuildSRPM]build[/url] a non-interfering python27 package. Note that there are a bunch of other python26-related packages:
python26-PyXML-0.8.4-23.el5.src.rpm
python26-argparse-1.2.1-3.el5.src.rpm
python26-boto-2.0-1.el5.src.rpm
python26-crypto-2.3-5.el5.src.rpm
python26-distribute-0.6.10-4.el5.src.rpm
python26-eventlet-0.9.9-1.el5.src.rpm
python26-greenlet-0.3.1-3.el5.src.rpm
python26-httplib2-0.6.0-2.el5.src.rpm
python26-imaging-1.1.7-4.el5.src.rpm
python26-jinja2-2.5.5-4.el5.src.rpm
python26-ldap-2.3.12-2.el5.src.rpm
python26-m2crypto-0.21.1-5.el5.src.rpm
python26-markupsafe-0.11-3.el5.src.rpm
python26-mod_python-3.3.1-13.el5.src.rpm
python26-mod_wsgi-3.3-1.el5.src.rpm
python26-nose-0.11.1-3.el5.src.rpm
python26-numpy-1.5.1-5.el5.src.rpm
python26-paramiko-1.7.7.1-1.el5.src.rpm
python26-simplejson-2.1.1-1.el5.src.rpm
python26-sqlalchemy-0.6.4-1.el5.src.rpm
python26-virtualenv-1.5.1-3.el5.src.rpm

You would likely have a better chance of success starting on a CentOS-6 base, as it already has python-2.6.6-29.el6, or going to a recent Fedora that has 2.7 native.

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 23:31:53
by sturdyworks
The aplications (such as Python) and libraries for CentOS, RHEL were all created with the Free Software Foundation's autoconf and libtool tools These tools generate the familiar *.tar.gz or *.tgz (compressed tar balls) you see all over the Internet. RPMs wrap the tar balls. The RPM Package Manager is one of several approaches to adding better tools to manage the use of the code tarballs may produce.

Because niether CentOS 5.x or 6.x use Python 2.7.2 there is no real reason to have to deal with RPM Manager at all. To get a basic 2.7.2 interpreter all you do is:
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzvf Python-2.7.2.tgz
cd Python-2.7.2
./configure
make altinstall

Check out this basic guide:
http://russell.ballestrini.net/a-system-administrators-guide-to-installing-and-maintaining-multiple-python-environments/

You do end up with a barebones Python environment but that is fine. It is easy to build up with the standard easy_install and pip (they are to Python what RPM is to RHEL/CentOS). Here are some guides.

Using Easy_install - Add modules from PyPi to Python
http://pypi.python.org/pypi/distribute
http://pypi.python.org/pypi/setuptools/0.6c11
Using PIP - An Easy_Install Replacement
http://pypi.python.org/pypi/pip

You can do a 'yum list "*python*" to get some Python module names, but you need to install them with your python2.7 interpreter because the named modules have specific versions for 2.6.2, 2.7.2, etc. I think you are better off browsing PyPi (the cheese shop) than yum list.

Hope that helps.

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 23:39:51
by milosb
[quote]
sturdyworks wrote:
Because niether CentOS 5.x or 6.x use Python 2.7.2 there is no real reason to have to deal with RPM Manager at all. [/quote]

I couldn't disagree more:
[url=http://wiki.centos.org/PackageManagement/SourceInstalls]Software installation from source[/url] :roll:

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/23 23:58:43
by sturdyworks
Why is'nt there a 2.7.2 rpm :-)

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/24 00:08:02
by TrevorH
Because if CentOS was about giving you the latest of everything it wouldn't be CentOS it would be Fedora. If you want to be on the bleeding edge then you have to run a bleeding edge distribution, if you want stability then you stick with an enterprise one.

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/24 01:20:17
by sturdyworks
make altinstall does not touch the CentOS system. Either 3.2 (bleeding edge) or 2.7 can be used. You really need to get a clue. The is no reason to use RPM for non-system related software. It is completely seperate, and many times everthing is created inside a virtual environment. You ned to edulate yourself. Having Python 2.7.2 is seperate.

Re: Python 2.7 installation on centos 5 without distrurbing yum

Posted: 2012/01/24 09:34:35
by r_hartman
[quote]
sturdyworks wrote:
You really need to get a clue. [ ... ] You ned to edulate yourself.[/quote]
Tough talk, wow. However, I'd say [b]you[/b] are the one this applies to.

Have you ever considered the basic difference between package-managed and non-package-managed distributions?
As soon as you move away from the basics and start doing source installs, it is you who will be responsible for maintaining the software, updating when security fixes are being released, recompiling affected packages, etc. Not to mention being on your own for support. Not doing source installs is not just about not 'touching' the core distro. If you [b]must[/b] install stuff that's not available in a package you should either move to a distro that has the required package, or use a source rpm to create your own package, to be installed through yum.

Anything you install outside of the package management system is invisible to that system, and thus prone to being forgotten and becoming stability and/or security risks. The prime reason for using a package managed distro is to ensure the system can be easily and safely maintained, with minimal stability risks, as all packages are kept current with discovered exploits and already have been tested to work without issues on the vast majority of installed systems.

If the OP really, really needs python 2.7, the best advice has already been given: pick a Fedora version that has it natively. If whatever he wants to develop depends on stuff in 2.7, he won't be able to distribute it to CentOS based systems anyway. If CentOS/RHEL is the target platform, he should really reconsider [i]why[/i] 2.7 is so important to him and possibly re-evaluate 'need-to-haves' versus 'nice-to-haves'.

EDIT: Looks like I should've [url=https://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=35354&forum=38]saved my breath[/url] here. What a clown.