一、编译前准备
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
原文地址:http://jiayimeng.blog.51cto.com/10604001/1881888