一、编译前准备
1、准备源码包
[[email protected] ~]# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz [[email protected] ~]# wget http://archive.ipython.org/release/1.2.1/ipython-1.2.1.tar.gz
2、准备编译环境
2.1python编译所需的包
[[email protected] ~]# yum install readline-devel
2.2安装开发包组
[[email protected] ~]# yum groupinstall "Development tools"
二、编译安装
1、python编译安装
[[email protected] ~]# tar xf Python-2.7.12.tar.xz [[email protected] ~]# cd Python-2.7.12 [[email protected] Python-2.7.12]# ./configure --prefix=/usr/local/python27 [[email protected] Python-2.7.12]# make && make install
2、ipython模块编译安装
[[email protected] ~]# tar xf ipython-1.2.1.tar.gz [[email protected] ~]# cd ipython-1.2.1 [[email protected] ipython-1.2.1]# /usr/local/python27/bin/python2.7 setup.py install [[email protected] ipython-1.2.1]# /usr/local/python27/bin/python2.7 setup.py build
3、添加软连接
[[email protected] ~]# ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python27 `/usr/bin/python27‘ -> `/usr/local/python27/bin/python2.7‘ [[email protected] ~]# ln -sv /usr/local/python27/bin/ipython /usr/bin/ `/usr/bin/ipython‘ -> `/usr/local/python27/bin/ipython‘
时间: 2024-10-21 12:58:37