查看python的版本

python  -V
Python 2.6.6  

下载Python   Python-2.7.8.tar.xz      链接:http://pan.baidu.com/s/1i4cCIR7 密码:j570

https://yunpan.cn/cB3ddbtUE8yeu  访问密码 0e70
yum -y install gcc automake autoconf libtool make
yum install zlib-devel
yum install -y openssl*
yum install -y bzip2* 

安装

tar -xvf Python-2.7.8.tar.xz
./configure  
make all    
          make install  
make clean  

make distclean  

查看版本信息

/usr/local/bin/python2.7 -V  

Python 2.7.8 

建立软连接,使系统默认的 python指向 python2.7

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

重新检验Python 版本

python  -V
Python 2.7.8 

解决Python软链接指向 Python2.7 版本后,yum不能正常工作的问题。因为yum是不兼容 Python 2.7的,所以需要指定 yum 的Python版本

vim /usr/bin/yum   

将文件头部的

#!/usr/bin/python 

改成

#!/usr/bin/python2.6.6 

艺搜参考

https://www.python.org/ftp/python/2.7.8/

https://www.python.org/download/releases/2.7.8/

CentOS升级Python 2.6到2.7的更多相关文章

  1. Centos 升级 python

    昨天把redmine的测试环境给搞Over了,想了下,干脆直接把环境给整成docker化的,配置环境的时候,安装docker-compose需要python2.7支持. CentOS 6 系统默认 P ...

  2. liunx CentOS 升级Python版本

    CentOS python版本是V2.6.6,升级3.4.3. 1.下载 安装包:wget http://www.python.org/ftp/python/3.4.3/Python-3.4.3.tg ...

  3. centos升级python到2.7

    最近在阿里云租了一个云主机,打算部署自己的个人网站,但是centos系统的默认Python是2.6版本,打算升级到2.7.3! 查看python的版本 #python  -V Python 2.6.6 ...

  4. 【转】Centos升级Python 2.7.12并安装pip、ipython

    Centos系统一般默认就安装有Python2.6.6版本,不少软件需要2.7以上的,通过包管理工具安装不了最新的版本,通过源码编译可以方便安装指定版本,只需要把下面版本的数字换成你想要的版本号. 1 ...

  5. CentOS升级Python的方法

    centOS内核版本为:3.10.101-1.el6.elrepo.x86_64 1,下载Python安装包 wget http://www.python.org/ftp/python/2.7.6/P ...

  6. centos升级python(从2.6.6升级到2.7.8)

    ***先安装readline,否则升级后python回退和方向键不能使用 yum install readline-devel.x86_64   1.#wget www.python.org/ftp/ ...

  7. Centos升级Python及pip

    因为CentOS系统中旧版本的Python已被深度依赖,所以不能卸载原有的Python,只能全新安装. 1.从官网下载: wget https://www.python.org/ftp/python/ ...

  8. centos 升级 python后 python-setuptools pip 安装依赖报错

    解决办法: $ wget https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.p ...

  9. CentOS升级Python到2.7版本

    查看python的版本 1 python -V Python 2.4.3 1.先安装GCC 1 yum -y install gcc 2.下载Python-2.7.2 1 wget http://py ...

随机推荐

  1. Java for LeetCode 230 Kth Smallest Element in a BST

    解题思路: 直接修改中序遍历函数即可,JAVA实现如下: int res = 0; int k = 0; public int kthSmallest(TreeNode root, int k) { ...

  2. Django函数——url()

    The url() function is passed four arguments, two required: regex and view, and two optional: kwargs, ...

  3. ABAP 内表的行列转换

    http://www.cnblogs.com/qlp1982/p/3370591.html

  4. Effective C++ -----条款19:设计class犹如设计type

    Class的设计就是type的设计.在定义一个新type之前,请确定你已经考虑过本条款覆盖的所有讨论主题. 新type的对象应该如何被创建和销毁? 对象的初始化和对象的赋值该有什么样的区别? 新typ ...

  5. VC++ 之常见内存异常值

    0 VC++ 常见的内存异常值 * 0xcccccccc : Used by Microsoft's C++ Debugging runtime library to mark uninitialis ...

  6. HTML中表格元素TABLE,TR,TD及属性的语法

    table:表格元素及属性 <table width="80%" border="1" cellspacing="1" cellpad ...

  7. Parallels Destop软件配置

    Parallels Destop个人感觉最好用的mac虚拟win软件 http://pan.baidu.com/s/1jHFwIGm 密码:ab21百度云下载(或者下载自己百度云的) 安装方法: 1. ...

  8. 【leetcode】Search for a Range(middle)

    Given a sorted array of integers, find the starting and ending position of a given target value. You ...

  9. UbuntuLinux安装Mysql

    1.安装Mysql5.7 方法:手动安装5.7 One:     $ wget http://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb 下载 ...

  10. eclipse failed to create the java virtual machine 问题图文解析

    eclipse failed to create the java virtual machine 问题图文解析 分类: java常用软件异常2010-10-02 23:45 73200人阅读 评论( ...