本文简要的介绍如何方便的在Windows环境下使用VirtualEnv进行开发工作。
1、首先在系统中安装virtualenv:

2、构造项目目录,为项目安装虚拟环境:
首先创建了项目文件夹myproject,然后在该文件夹中安装了虚拟环境env。

3、启动虚拟环境,安装所需类库:
在windows中虚拟环境的启动使用命令:your_env_dirScriptsactivate
默认情况下,virtualenv已经安装好了pip。在启动虚拟环境后直接使用pip install 命令就可以为该虚拟环境安装类库:

4、在虚拟环境中可以进行运行脚本等操作:
脚本代码如下:

在虚拟环境中运行该脚本:

5、离开虚拟环境,使用deactivate命令:

6、在系统环境中,我们并没有安装flask类库,可以对比在系统环境中和虚拟环境中的脚本运行效果:

7、总结:
virtualenv虚拟环境为每个项目隔离了一套运行类库,不同的项目在各自的虚拟环境中使用不同的类库,避免了将所有类库都安装到系统环境中导致的不同项目需要不同(版本)类库的问题,项目与项目之间的类库依存不再成为问题。
参考文献:
1、Python脚本来自于:https://www.shiyanlou.com/courses/document/259
2、《virtualenv的安装和使用》:http://my.oschina.net/lpe234/blog/343639