## 下载
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz
## 解压
xz -d Python-3.6.8.tar.xz
tar -xf Python-3.6.8.tar
## 安装#进入解压后的目录,依次执行下面命令进行手动编译
sudo ./configure prefix=/usr/local/python3
make && make install
安装pip
sudo yum -y install epel-release
sudo yum -y install python-pip
安装virtualenv
sudo pip install virtualenv
sudo mkdir /var/python_test
cd /var/python_test
sudo virtualenv -p /usr/local/python3/bin/python3 python3
搞定!
source /var/python_test/python3/bin/activate
deactivate