www.cnblogs.com/guozw/p/630…

1. Install VirtualEnv in the system

After Python is installed, the PIP or easy_install tool is provided to install VirtualEnv

pip install virtualenv

2. Construct the project and install the virtual environment for the project

For example, I create a project called myProject under F:\Python Program

Go to the directory shown above and create the folder myProject

3. Go to the project directory and create a virtual environment

4. Enter the virtual environment and install flask

Indicates that you are already in the virtual environment

Create a simple Python script

hello.py

6. Run the script in the virtual environment

7. Enter the address in the browser to view the result

8. Run deactivate to leave the virtual environment

The beginning of the second line disappears, indicating that you have left the virtual environment

9,

Virtualenv (1) isolated from the virtual environment for each project a class library operation, different project in their own virtual environment using different class libraries, avoids all libraries installed on your system environment lead to the different project needs (version) of libraries, library dependency between projects and project is no longer a problem.

(2) The virtualenv environment is installed in the Python directory F:\Python27\Lib\site-packages, and the virtual environment created by each project is an instance.