美文网首页
在Centos7编译安装Python3

在Centos7编译安装Python3

作者: GeneNote基因笔记 | 来源:发表于2022-11-28 23:00 被阅读0次

    Liunx环境准备

    yum update -y
    yum -y install gcc automake autoconf libtool make zlib* readline-devel
    

    python 安装包国内镜像

    https://registry.npmmirror.com/binary.html?path=python/

    选择合适版本

    下载python安装包

    wget https://registry.npmmirror.com/-/binary/python/3.6.9/Python-3.6.9.tgz
    

    创建安装目录

    mkdir -p /usr/local/python3
    

    解压安装

    tar -zxvf Python-3***.tgz
    cd Python-3.*.*
    ./configure --prefix=/usr/local/python3
    make && make install
    

    建立软链接

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

    测试安装

    [root@centos-1 ~]# python3 --version
    Python 3.6.15
    

    相关文章

      网友评论

          本文标题:在Centos7编译安装Python3

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