Install python 2.6 / turbogears 1.1 on CentOS

Install python 2.6 / turbogears 1.1 on CentOS_胡说八道_百度空间

Install python 2.6 / turbogears 1.1 on CentOS
2010-12-19 22:48

脑残百度空间还设了个标题max length 50,搞笑么。

目前很多主机都用CentOS,这个上面默认的Python是2.4,很弱。

Python2.6:

$ sudo rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm

$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL

$ sudo yum install python26

If you get a message saying "Error: Missing Dependency: libffi.so.5 is needed by package python26-2.6.2-2.i386 (chl)",

$ wget ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/libffi-3.0.5-1.el5.kb.i386.rpm

$ rpm -i libffi-3.0.5-1.el5.kb.i386.rpm

That'll do it. Run 'python26' instead of 'python' to start python 2.6.

Setuptools 0.6c11

$ wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086

$ sh setuptools-0.6c11-py2.6.egg

Turbogears 1.1.1

$ easy_install turbogears

MySQL-python

$ easy_install MySQL-python

if it fails to compile, it's probably because:

1. You don't have python-devel. run:

$ yum install python-devel

2. You don't have gcc or your gcc is outdated or corrupted.

$ yum install gcc

and MySQL-python should be able to install.

OK, if it still fails, try:

$ yum install MySQL-python

and 

$ yum install mysql-devel.i386

and easy_install MySQL-python should work now.

原文地址:https://www.cnblogs.com/lexus/p/2365596.html