首页 > 代码库 > Cent OS6.7编译安装python2.7
Cent OS6.7编译安装python2.7
一、编译前准备
1、准备源码包
[root@node3 ~]# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz [root@node3 ~]# wget http://archive.ipython.org/release/1.2.1/ipython-1.2.1.tar.gz
2、准备编译环境
2.1python编译所需的包
[root@node3 ~]# yum install readline-devel
2.2安装开发包组
[root@node3 ~]# yum groupinstall "Development tools"
二、编译安装
1、python编译安装
[root@node3 ~]# tar xf Python-2.7.12.tar.xz [root@node3 ~]# cd Python-2.7.12 [root@node3 Python-2.7.12]# ./configure --prefix=/usr/local/python27 [root@node3 Python-2.7.12]# make && make install
2、ipython模块编译安装
[root@node3 ~]# tar xf ipython-1.2.1.tar.gz [root@node3 ~]# cd ipython-1.2.1 [root@node3 ipython-1.2.1]# /usr/local/python27/bin/python2.7 setup.py install [root@node3 ipython-1.2.1]# /usr/local/python27/bin/python2.7 setup.py build
3、添加软连接
[root@node3 ~]# ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27 `/usr/bin/python27‘ -> `/usr/local/python27/bin/python2.7‘ [root@node3 ~]# ln -sv /usr/local/python27/bin/ipython /usr/bin/ `/usr/bin/ipython‘ -> `/usr/local/python27/bin/ipython‘
本文出自 “linux启航” 博客,请务必保留此出处http://jiayimeng.blog.51cto.com/10604001/1881888
Cent OS6.7编译安装python2.7
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。