The Virtualenvwrapper-win of python--virtual environment

Source: Internet
Author: User
Tags virtual environment

1 Problem description

When M projects require n versions of the Python Environment Configuration (m>n), we don't need to create a virtual environment for each project, just create n virtual environments. This reduces the amount of work (especially when m is much larger than N). But how do you create these n environments and manage those environments?

2 Problem Solving Ideas

Through the three-party package Virtualenvwrapper-win to solve. Virtualenvwrapper-win is a toolkit based on virtualenv development. It can be scattered in various paths under the virtual environment, centralized to the unified path to manage, convenient for each virtual environment switch.

3 Specific resolution steps

 3.1 Installing Virtualenvwrapper-win

Open a command prompt, enter the following name to install

    Pip Install Virtualenvwrapper-win

Or

    python3-m pip Install Virtualenvwrapper-win

3.2 Virtualenvwrapper-win Instructions for use

    3.2.1 Creating a virtual environment
(1) syntax
MKVIRTUALENV Virtual Environment Name

(2) interface effect

        


(3) Effect of effect
will be created in a specific folder. Under Windows, the default is in the Envs folder of the user directory
3.2.2 Activating a virtual environment

      The newly created virtual environment is automatically activated when the creation is complete, or you can activate the virtual environment with the Workon command, as shown in the following code:
Workon Virtual Environment Name

Example: Workon ENV2

    3.2.3 View all Virtual environments
(1) syntax
Lsvirtualenv

Or
Workon

(2) interface effect

(3) Effect of effect

List all virtual environments created in the Envs folder

    3.2.4 Switching Active Virtual Environments

(1) syntax
Workon Virtual Environment Name

(2) interface effect

        

(3) Effect of effect

Exits the virtual environment ENV1 and activates the specified virtual environment ENV2.

3.2.4 shutting down the virtual environment
(1) syntax
Deactivate

(2) interface effect

          

(3) Effect of effect
Turn off the active virtual environment
3.2.5 Deleting a virtual environment
(1) syntax
RMVIRTUALENV Virtual Environment Name

(2) interface effect

The effect of the pre-deletion interface is as follows:
        

After deleting the interface effect is as follows:

        

(3) Effect of effect
Deletes the specified virtual environment, deletes the corresponding folder, and exits the activation state of the corresponding virtual environment.

More operations See official website address: Https://pypi.python.org/pypi/virtualenvwrapper-win

    

The Virtualenvwrapper-win of python--virtual environment

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.