centos7 安装 python3.7

Posted 巫小诗

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 安装 python3.7相关的知识,希望对你有一定的参考价值。

  • 安装依赖

    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
    
    yum install libffi-devel -y
  • 下载安装包

    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar -xvf  Python-3.7.0.tar.xz
  • 切入安装包

    cd Python-3.7.0
  • 配置

    ./configure --enable-optimizations  --prefix=/usr/local/python3
  • 编译和编译安装

    make && make install
  • 建立软连接

    ln -s /usr/local/python3/bin/python3.7  /usr/bin/python3
    ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
  • 测试

    > python3
    > pip3 list
  • 至此python3.7的环境搭建成功

以上是关于centos7 安装 python3.7的主要内容,如果未能解决你的问题,请参考以下文章

centos7.5安装python3.7

CentOS7安装Python3.7

CentOS7安装Python3.7

Centos7 安装Python3.7

centos7安装python3.7

centos7 安装 python3.7