# 获取 python 包,可从python官网获取
yum install wget && wget http://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz && tar -xzvf Python-3.6.2.tgz
# 编译python
cd Python-3.6.2 &&
mkdir /usr/local/python362 && ./configure --prefix=/usr/local/python362 && make && make install;
# 虚拟环境创建,可以自定义虚拟环境的路径 例如 此处我设置的是 /py362
virtualenv --python=/usr/local/python362/bin/python3 /py362
# 检验虚拟环境
source /py362/bin/activate
python -V