安装依赖

    yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel

下载 https://www.python.org/ftp/python

    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

配置

    ./configure --prefix=/usr/local/python3 --enable-optimizations

编译

    make && make install 

配置源

    vim ~/.pip/pip.conf

    阿里云
    [global]
    index-url=http://mirrors.aliyun.com/pypi/simple/

    [install]
    trusted-host=mirrors.aliyun.com

    清华
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple