...安装IUS,IUS provides Red Hat Package Manager(RPM) packages for some newer versions of select software.
...https://ius.io/GettingStarted/
yum upate
yum install https://centos6.iuscommunity.org/ius-release.rpm
安装最新版本Python3.6.x
yum install python36u python36u-pip
yum install python36u-devel
创建软链接
ln -s /usr/bin/python3.6 /usr/bin/python3
ln -s /usr/bin/pip3.6 /usr/bin/pip3
如图:
python3.6安装成功,接下来安装虚拟环境。
————————————————————————————————靓丽的分割线————————————————————————————————————————‘
’
Python自带虚拟环境
# if是Debian/Ubuntu, 需先apt-get install python3-venv
#先在终端进入想要创建的环境环境的目录
python -m venv pyenv #venv模块只有python3才有,2木有
#激活虚拟环境
pyenv/Scripts/activate.bat #windows
source pyenv/bin/activate #linux
#退出虚拟环境
pyenn/Scripts/deactivate.bat #windows
pyenv/bin/deactivate #linux
如下图: