VIRTUALENV installation and use on Windows

Source: Internet
Author: User
Tags virtualenv

Why Install virtualenv?
    • It is easy to solve the dependency problem of different projects on the class library.

    • You can avoid packet clutter and version conflicts in the Python interpreter in the system.

Creating a separate virtual environment for each program ensures that the program can only access packages in the virtual environment, keeping the global interpreter clean and concise.

    • The advantage of using a virtual environment is that you don't need administrator privileges

CAST:

1. Installing virtualenv

2. Installing a virtual environment for a project

You first create the project folder New_porject, open the file,

Install Virtual Environment env, execute: virtualenv env

3. Start the virtual environment to install the required library 3.1 for the project to start the virtual environment

To start the virtual environment, use the command: your_env_dir\scripts\activate,

After activating the virtual environment, a <env> appears in front of the command in the CMD window, indicating that it is currently in a virtual environment.

3.2 Installing the class library in a virtual environment

By default, VIRTUALENV has been installed with PIP.

You can install the class library for the virtual environment by using the PIP Install command directly after you start the virtual environment:

4. Using the configured VIRTUALENV environment in Pycharm

Open setting Add local python environment:

Select the virtual environment you just created:

VIRTUALENV installation and use on Windows

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.