Windows uses virtualenv and virtualenvwrapper-win
In Windows
use on virtualenv
multiple versions of Python
isolation.
installationPython
In the Python
official website to download Python 3.X or Python 2.X
, double-click install 记得勾选Add to Path
,
In cmd
the input Python
, test Path
path is correct, if not enter Python shell
, go to Python
the installation directory, copy the path, right- 此电脑-->属性-->高级系统设置-->环境变量-->系统变量-->Path-->编辑-->新建-->粘贴
final a plus \
.
In the cmd
test again in.
Installation and virtualenvwrapper-win virtualenv
pip install virtualenv
Windows
Use virtualenvwrapper-win
,
pip install virtualenvwrapper-win
Add WORKON_HOME
path, right 此电脑-->属性-->高级系统设置-->环境变量-->系统变量-->新建
, the variable name WORKON_HOME
, the variable value 创建的虚拟目录的路径
.
Create a virtual directory
In the WORKON_HOME
directory, use virtualenv --no-site-package py2
, if you do not use virtualenvwrapper-win
, you need to enter py2/Scripts/
the following, the implementation of activate.bat
exit needs to be performed deactivate.bat
.
Use workon py2
direct access to the virtual environment.