Tutorial on building virtualenv and virtualenvwrapper virtual environments in windows,
Virtualenv1. install virtualenv
pip install virtualenv
2. Create a virtual environment
virtualenv bobbyvir
Note: 1. The virtual environment is located in the directory of the current command. Here is E: \ Projects \ projectsedu.com 2. The virtual environment name is bobbyvir.
3. Enter the Virtual Environment
1) enter the virtual environment directory: cd E: \ Projects \ projectsedu. com2) enter the script directory: cd bobbyvir \ Scripts2) Run activate. bat: activate. bat
View the default library installed in the virtual environment
pip list
4. Install the development library in the virtual environment. Here, the requests library is used as a reference.
pip install request
5. Exit virtualenv
deactivate.bat
Virtualenvwrapper
We need to go to the virtualenv directory every time we enter the virtual directory. Once there are too many virtualenv files, it will hurt. Next we recommend virtualenvwrapper.
1. Install virtualenvwrapper
Pip install virtualenvwrapper-win Note: Run pip install virtualenvwrapper in linux
Set WORK_HOME Environment Variables
2. Create a virtual environment
mkvirtualenv bobbyvir
Note: Because WORK_HOME is set in the previous step, all virtual environments will be installed in E: \ virtualevn
3. view all installed Virtual Environments
workon
Note: you cannot view the virtual environment created by virtualenv. You can only view the virtual environment created by mkvirtualenv.
4. Enter the Virtual Environment
workon bobbyvir
5. Exit the Virtual Environment
deactivate
Do you think so easy?