Python 2.7 installation on centos 5 without distrurbing yum

Issues related to software problems.

Python 2.7 installation on centos 5 without distrurbing yum

Postby reetika » 2012/01/23 08:09:48

By default centos 5 has python 2.4. I want to install python 2.7 on cent os 5 Please help
reetika
 
Posts: 2
Joined: 2012/01/23 07:50:59

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby TrevorH » 2012/01/23 09:40:43

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.
User avatar
TrevorH
Forum Moderator
 
Posts: 9130
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby reetika » 2012/01/23 11:38:54

No i need python 2.7 for my project
reetika
 
Posts: 2
Joined: 2012/01/23 07:50:59

Python 2.7 installation on centos 5 without distrurbing yum

Postby pschaff » 2012/01/23 22:44:47

Then your best bet is to start with the EPEL python26-2.6.5-6.el5.src.rpm and use it as a guide to attempt to build 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.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby sturdyworks » 2012/01/23 23:31:53

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 ... ironments/

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.
sturdyworks
 
Posts: 22
Joined: 2011/06/12 23:35:19
Location: Orange County, CA area

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby milosb » 2012/01/23 23:39:51

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.


I couldn't disagree more:
Software installation from source :roll:
milosb
 
Posts: 661
Joined: 2009/01/18 00:39:15
Location: 44 49′14″N 20 27′44″E

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby sturdyworks » 2012/01/23 23:58:43

Why is'nt there a 2.7.2 rpm :-)
sturdyworks
 
Posts: 22
Joined: 2011/06/12 23:35:19
Location: Orange County, CA area

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby TrevorH » 2012/01/24 00:08:02

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.
User avatar
TrevorH
Forum Moderator
 
Posts: 9130
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby sturdyworks » 2012/01/24 01:20:17

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.
sturdyworks
 
Posts: 22
Joined: 2011/06/12 23:35:19
Location: Orange County, CA area

Re: Python 2.7 installation on centos 5 without distrurbing yum

Postby r_hartman » 2012/01/24 09:34:35

sturdyworks wrote:
You really need to get a clue. [ ... ] You ned to edulate yourself.

Tough talk, wow. However, I'd say you 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 must 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 why 2.7 is so important to him and possibly re-evaluate 'need-to-haves' versus 'nice-to-haves'.

EDIT: Looks like I should've saved my breath here. What a clown.
r_hartman
 
Posts: 701
Joined: 2009/03/23 15:08:11
Location: Netherlands

Next

Return to CentOS 5 - Software Support

Who is online

Users browsing this forum: No registered users and 4 guests