zoukankan      html  css  js  c++  java
  • centos python2.6 升级到 python2.7

    基本环境

    yum -y install wget gcc xz tar

    安装 zlib (如果不装zlib setuptools可能报错 "Compression requires the (missing) zlib module")

        1. wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.11.tar.gz?download

     2. tar -xvf zlib-1.2.11.tar.gz 

     3. cd zlib-1.2.11  &&  ./configure && make && make install

    安装 python

    1. wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz

    2. xz -d Python-2.7.12.tar.xz && tar -xvf Python-2.7.12.tar 

    3. cd Python-2.7.12 && ./configure && make && makeinstall

    4. mv /usr/bin/python /usr/bin/python2.6.6

    5. ln -s /usr/local/bin/python /usr/bin/python

    6. yum只支持2.6所以需要将 /usr/bin/yum 的头部修改成 #!/usr/bin/python2.6.6

    如果python 报错”error while loading sharedlibraries: libpython2.7.so.1.0: cannot open shared object file: No such file ordirectory”

    vim /etc/ld.so.conf 下一行加 /usr/local/lib  然后执行  /sbin/ldconfig -v

    安装 setuptools

    1. wget https://pypi.python.org/packages/a9/23/720c7558ba6ad3e0f5ad01e0d6ea2288b486da32f053c73e259f7c392042/setuptools-36.0.1.zip#md5=430eb106788183eefe9f444a300007f0

    2. unzip setuptools-36.0.1.zip && cd setuptools-36.0.1

    3. python setup.py install

    4. easy_install pip

    http://blog.csdn.net/shaojunbo24/article/details/52300428

    http://blog.csdn.net/ab198604/article/details/8681851

    http://blog.csdn.net/laiahu/article/details/6903100

    http://blog.csdn.net/shanliangliuxing/article/details/18499625

  • 相关阅读:
    npm使用淘宝镜像源
    MapReduce任务执行源码分析
    spark.sql.shuffle.partitions到底影响什么
    hdfs的写入数据流程及异常情况分析
    面试题
    HDFS的双缓冲机制详解
    rpm包无法卸载
    hive建表支持的文件类型与压缩格式
    centos6中同时安装python3.7与python2.6
    linux centos6.x安装mysql5.6.33版本
  • 原文地址:https://www.cnblogs.com/aaron-agu/p/7133754.html
Copyright © 2011-2022 走看看