• python2.7.5升级到2.7.14或者直接升级到3.6.4


    python2.7.5升级到2.7.14

    1.安装升级GCC

    yum install -y gcc* openssl openssl-devel ncurses-devel.x86_64  bzip2-devel sqlite-devel  zlib python-devel mysql-devel openldap-devel

    2.下载python安装包

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

    3.解压

    tar -xvf Python-2.7.14.tar.xz
     
    4.编译安装
    cd Python-2.7.14
    ./configure --prefix=/usr/local
    make && make install
     
    5.将老版本python更换
    mv /usr/bin/python /usr/bin/python2.7.5
     
    6.更换默认python
    ln -s /usr/local/bin/python2.7  /usr/bin/python
     
    7.#修改 yum以及urlgrabber-ext-down中的python
    将#!/usr/bin/python改为 #!/usr/bin/python2.7.5
    vim /usr/bin/yum
    vim /usr/libexec/urlgrabber-ext-down
     

    8.安装setuptools
    wget --no-check-certificate https://pypi.python.org/packages/69/56/f0f52281b5175e3d9ca8623dadbc3b684e66350ea9e0006736194b265e99/setuptools-38.2.4.zip#md5=e8e05d4f8162c9341e1089c80f742f64
    unzip setuptools-38.2.4.zip
    cd setuptools-38.2.4
    python setup.py install
    cd ..

    9.安装pip
    wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
    tar -xvf 1.5.5.tar.gz #解压文件
    cd pip-1.5.5/
    python setup.py install

     
     
    python2.7.5升级到3.6.4

    yum install -y gcc* openssl openssl-devel ncurses-devel.x86_64  bzip2-devel sqlite-devel  zlib python-devel mysql-devel openldap-devel

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

    tar -xvf Python-3.6.4.tar.xz

    cd Python-3.6.4

    mkdir -p /usr/local/python3

    ./configure --prefix=/usr/local/python3

    make && make install

    mv /usr/bin/python /usr/bin/python2.7.5

    ln -s /usr/local/python3/bin/python3 /usr/bin/python

    ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip

     
    #修改 yum以及urlgrabber-ext-down中的python
    将#!/usr/bin/python改为 #!/usr/bin/python2.7.5
    vim /usr/bin/yum
    vim /usr/libexec/urlgrabber-ext-down
     
    PS:python3.6.4是默认安装pip的,所以不需要另行安装setuptools和pip.
  • 相关阅读:
    使用T4为数据库自动生成实体类
    asp.net 下OnClientClick的妙用
    使用缓存的9大误区(上)
    使用缓存的9大误区(下)
    毕业后的五年拉开大家差距的原因在哪里
    mysql字符集
    redhat网络基础配置
    mysql远程连接问题
    Hibernate hql语句修改部分字段
    JQuery使用方法总结
  • 原文地址:https://www.cnblogs.com/cjsblogs/p/8117272.html
Copyright © 2020-2023  润新知