在CentOS 6.5上安装Python2.7

摘要

在CentOS 6.5上安装Python2.7 1.yum groupinstall “Devel […]

CentOS 6.5上安装Python2.7

1.yum groupinstall “Development tools”

2.安装编译Python需要的组件

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel

3.下载并解压最新Python 2.7的源代码

wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz 
tar xf Python-2.7.10.tar.xz

4.编译与安装Python

cd Python-2.7.10 
./configure –prefix=/usr/local

make && make install 
make clean 
make distclean

5.将系统python命令指向Python 2.7

mv /usr/bin/python /usr/bin/python2.6.6 
ln -s /usr/local/bin/python2.7 /usr/bin/python

6.将yum需要执行的python指定为2.6.6

vi /usr/bin/yum

将文件头部的

#!/usr/bin/python

改成

#!/usr/bin/python2.6.6

Ubuntu 14.04安装Python 3.3.5  http://www.searu.org/2014-05/101481.htm

CentOS上源码安装Python3.4  http://www.searu.org/2015-01/111870.htm

《Python核心编程 第二版》.(Wesley J. Chun ).[高清PDF中文版] http://www.searu.org/2013-06/85425.htm

《Python开发技术详解》.( 周伟,宗杰).[高清PDF扫描版+随书视频+代码] http://www.searu.org/2013-11/92693.htm

Python脚本获取Linux系统信息 http://www.searu.org/2013-08/88531.htm

在Ubuntu下用Python搭建桌面算法交易研究环境 http://www.searu.org/2013-11/92534.htm

更多CentOS相关信息见CentOS 专题页面 http://www.searu.org/topicnews.aspx?tid=14

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: