美文网首页我爱编程
centos安装python3

centos安装python3

作者: SolaTyolo | 来源:发表于2018-04-13 13:12 被阅读0次

    centos自带的python是2.7的,但是2.7python已经逐渐被抛弃,纷纷转到python3le。故记录下centos安装python3的流程

    先安装依赖包

    yum -y groupinstall "Development tools"
    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
    

    下载python3的包

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

    解压并安装

    mkdir /usr/local/python3 
    tar -xvJf  Python-3.6.2.tar.xz
    cd Python-3.6.2
    ./configure --prefix=/usr/local/python3
    make && make install
    

    创建软链接

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

    相关文章

      网友评论

        本文标题:centos安装python3

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