zoukankan      html  css  js  c++  java
  • 为CentOS下的Docker安装配置python3【转】

    安装python3以及docker

    yum install docker
    docker pull centos
    service docker start
    systemctl enable docker    //设置为开机自启动
    docker images
    

     

    #开始安装docker
    docker run -i –t centos /bin/bash
    #这时进入centos虚拟环境
    yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel  -y
    yum -y install gcc automake autoconf libtool make
    #安装make编译所需的gcc,g++编译器
    
    #开始安装python3
    yum install wget
    wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
    tar zxvf Python-3.5.3.tgz
    mv Python-3.5.3 /usr/local
    cd /usr/local/Python-3.5.3 
    ./configure   
    make
    make install
    
    #删除旧版本的依赖,并创建软链接
    rm -rf /usr/bin/python
    ln -s /usr/local/bin/python3.5 /usr/bin/python
    
    #没想到最后python3与python2冲突了,导致yum不能用了,不过修改一下
    vi /usr/bin/yum
    vi /usr/libexec/urlgrabber-ext-down
    这两个文件开头的python为python2.7即可
    

     

    安装pip3

    1:安装依赖
    yum install openssl-devel   -y
    
    yum install zlib-devel  -y
    
    yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel -y
    
    2:安装setuptools
    wget --no-check-certificate  https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
    tar -zxvf setuptools-19.6.tar.gz
    rm -rf setuptools-19.6.tar.gz
    cd setuptools-19.6
    python3 setup.py build
    python3 setup.py install
    
    
    3:安装pip
    wget --no-check-certificate  https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb
    tar -zxvf pip-8.0.2.tar.gz
    rm -rf pip-8.0.2.tar.gz
    cd pip-8.0.2
    python3 setup.py build
    python3 setup.py install
    
    #更新为最新版
    pip install --upgrade pip  
    

     

    I can feel you forgetting me。。 有一种默契叫做我不理你,你就不理我

  • 相关阅读:
    开源网站
    Shape 与 InlineShape 的区别
    C#使用Word中的内置对话框实例
    C# Word 类库的深入理解
    C# 线程知识--使用ThreadPool执行异步操作
    C#如何以管理员身份运行程序
    C#的Enum——枚举
    MVC Action 返回类型[转]
    MVC3中Action返回类型ActionResult类型
    ASP.NET MVC 3.0 Controller基础
  • 原文地址:https://www.cnblogs.com/weidaijie/p/10621681.html
Copyright © 2011-2022 走看看