安装
1.下载文件
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz
2.进行安装
tar xf Python-3.7.1.tar.xz
cd Python-3.7.1
yum -y install gcc-* openssl-* libffi-devel sqlite-devel
./configure --enable-optimizations --with-openssl=/usr/bin/openssl
make -j4
make install
默认安装路径:/usr/local/lib/python3.7
3.更改安装源
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
4.升级pip
pip3 install --upgrade pip
5.安装虚拟环境工具
pip3 install virtualenv
6.创建虚拟环境
virtualenv web01
7.切换到虚拟环境
source web01/bin/activate
8.退出虚拟环境
deactivate