美文网首页
CentOS 7安装python3

CentOS 7安装python3

作者: yancoding | 来源:发表于2019-03-06 15:28 被阅读0次

    1.安装依赖

    sudo yum -y groupinstall "Development tools"

    sudo 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 libffi-devel

    2.安装

    下载
    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0a1.tar.xz
    解压
    tar -xvJf Python-3.7.0a1.tar.xz
    切换到解压目录
    cd Python-3.7.0a1
    配置 编译 安装
    ./configure preix=/usr/local/python3
    sudo make
    sudo make install

    3.设置软链

    ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
    ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

    注: 如何删除软链,用rm命令即可,例如
    rm /usr/bin/pip3

    相关文章

      网友评论

          本文标题:CentOS 7安装python3

          本文链接:https://www.haomeiwen.com/subject/ldntpqtx.html