Python Centos 安装

Python Centos 安装

1. 环境:

Centos7

Python3.6.1

2. 步骤

  • 下载可能用到的依赖

    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.6.1

    wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
  • 创建python3目录

    mkdir /usr/local/python3 
    
  • 解压

    tar -zxvf Python-3.6.1.tgz
    cd Python-3.6.1.tgz
  • 安装

    ./configure --prefix=/usr/local/python3
    make && make install
  • 创建python3和pip3软链接

    ln -s /usr/local/python3/bin/python3 /usr/bin/python3
    ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
  • 测试上述两个命令

    python3
    pip3
  • 测试结果如图:

python3安装成功截图
Python Centos 安装_第1张图片

你可能感兴趣的:(Python,Centos7,Python3.6安装)