Tutorial on building virtualenv and virtualenvwrapper virtual environments in windows,

Source: Internet
Author: User
Tags virtualenv

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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.