CentOS安装python2.6
分类: python 2011-10-28 11:01 60人阅读 评论(0) 收藏 举报
目前很多主机都用CentOS,这个上面默认的Python是2.4。 手动安装python2.6很麻烦,继续装什么pymssql之类的东东又会花很长时间。寻觅了好久,终于找到了一个好的办法:
系统:CentOS 5.3、5.4 。 有网络。
按如下操作:
- rpm-Uvhhttp://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm
- rpm--import/etc/pki/rpm-gpg/RPM-GPG-KEY-CHL
- yuminstallpython26
rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL yum install python26
如果出现"Error: Missing Dependency: libffi.so.5 is needed by package python26-2.6.2-2.i386 (chl)"的错误就做出下操作
- wgetftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/libffi-3.0.5-1.el5.kb.i386.rpm
- rpm-ilibffi-3.0.5-1.el5.kb.i386.rpm
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
然后再yum install python26 就安装完成了。
接下来安装Setuptools 0.6c11
- wgethttp://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086
- shsetuptools-0.6c11-py2.6.egg
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
如果需要python 的devel 就 yum install python26-devel