# Using python virtual environment on Windows

## Why am I writing in English

Recently I recommended my WeChat official account and blog to some friends, but they are not able to read Chinese, so I would like to try to write blogs in English and having more communication with them.

## Install virtual environment

If you want to use virtualenv on a path which contain spaces, you should install win32api

Using pip to install virtualenv

pip install virtualenv


## Create virtual environment

Open shell and cd to your project path. Then use the following command to create virtual environment.

virtualenv env_name

env_name is the name of the virtual environment, such as env

## Activate the virtual environment

At first you should know your virtualenv name, usually it's env then change the dir to your project root. Command:

env\scripts\activate

after that, a sign will display before the cmd to show that you enter the virtualenv successfully.

Now you can install any python packages in the virtualenv and do some other operations.

## Quit the virtual environment

enter

deactivate

to quit the virtual environment.