Windows uses the Python virtual environment

Windows uses virtualenv and virtualenvwrapper-win

In Windowsuse on virtualenvmultiple versions of Pythonisolation.

installationPython

In the Pythonofficial website to download Python 3.X or Python 2.X, double-click install 记得勾选Add to Path,

In cmdthe input Python, test Pathpath is correct, if not enter Python shell, go to Pythonthe installation directory, copy the path, right- 此电脑-->属性-->高级系统设置-->环境变量-->系统变量-->Path-->编辑-->新建-->粘贴final a plus \.

In the cmdtest again in.

Installation and virtualenvwrapper-win virtualenv

pip install virtualenv

WindowsUse virtualenvwrapper-win,
pip install virtualenvwrapper-win

Add WORKON_HOMEpath, right 此电脑-->属性-->高级系统设置-->环境变量-->系统变量-->新建, the variable name WORKON_HOME, the variable value 创建的虚拟目录的路径.

Create a virtual directory

In the WORKON_HOMEdirectory, 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.batexit needs to be performed deactivate.bat.

Use workon py2direct access to the virtual environment.

Guess you like

Origin www.cnblogs.com/zzhaolei/p/11068175.html