1. 首先下载Python3的相关依赖
    yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
  2. wget​​https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz​
  3. 解压
    tar -xvJf Python-3.6.2.tar.xz
  4. 切换进入
    cd Python-3.6.2
  5. 编译安装
    ./configure prefix=/usr/local/python3
    make && make install
    安装完毕,/usr/local/目录下就会有python3了
  6. 添加软链到执行目录下/usr/bin
    ln -s /usr/local/python3/bin/python3 /usr/bin/python3

最后敲python3
Centos7另外安装python3_sqlite

python3.6 -m pip install virtualenv
mkdir mytest
cd mytest
python3.6 -m virtualenv venv
source venv/bin/activate

如果新系统尚未安装工具pip,可通过以下三步来快速完成pip的安装

1.  yum -y install epel-release            
2. yum install python-pip
3. pip install --upgrade pip

三步解决安装pip工具的问题。

python3 -m pip install -r requirements.txt --no-cache-dir