• Centos7中安装Python3


    环境:CentOS 7

    1. 安装依赖环境

    # yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

    2. 浏览器打开 https://www.python.org/ftp/python/ 查看最新的Python版本,标记为3.A.B

    # wget https://www.python.org/ftp/python/3.A.B/Python-3.A.B.tgz

    3. 创建Python3的目录

    # mkdir /usr/local/python3

    4. 解压下载文件并切换目录

    # tar -zxvf Python-3.A.B.tgz

    # cd Python-3.A.B

    5. 执行

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

    # make && make install

    6. 创建Python3的软链接

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

    7. 创建Pip3的软链接

    # ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

    8. 测试命令 python3 和 pip3

    # python3

    # pip3

    安装保留了原python命令调用python2

    安装完成

    文章来自:http://blog.csdn.net/x_koozal/article/details/72432906

  • 相关阅读:
    Python shutil模块
    Flask 上传文件
    Flask DBUtils
    flash-session
    Flash 上下文管理
    python 栈
    python 偏函数
    threding.local
    next() 与 nextLine() 区别
    Thread.sleep(1000*3); // 休眠3秒
  • 原文地址:https://www.cnblogs.com/songxingzhu/p/8400533.html
Copyright © 2020-2023  润新知