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

Cent OS6.7编译安装python2.7

时间:2016-12-12 15:17:58      阅读:204      评论:0      收藏:0      [点我收藏+]

标签: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

标签:cent os6.7编译安装python2.7

原文地址:http://jiayimeng.blog.51cto.com/10604001/1881888

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