码迷,mamicode.com
首页 > 编程语言 > 详细

CentOS 安装Python 2.7

时间:2016-07-03 23:11:40      阅读:328      评论:0      收藏:0      [点我收藏+]

标签:

1,下载python最新版本并解压,当前最新版本为Python 2.7.12

  https://www.python.org/downloads/

  Python-2.7.12.tgz

  文件校验:

 

md5sum Python-2.7.12.tgz 
88d61f82e3616a4be952828b3694109d  Python-2.7.12.tgz
tar zxvf Python-2.7.12.tgz  

 

2,安装编译依赖包

yum groupinstall "Development tools"
yum install zlib-devel
yum install bzip2-devel
yum install openssl-devel
yum install ncurses-devel
yum install sqlite-devel

3,编译并安装python

cd Python-2.7.12
./configure --prefix=/usr/local
make && make altinstall

4,建立新python的软连接

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

python -V
Python 2.7.12

 

CentOS 安装Python 2.7

标签:

原文地址:http://www.cnblogs.com/Rsean/p/5638965.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!