Installation and use of the Flask virtualvenv (Windows)

Source: Internet
Author: User
Tags virtual environment virtualenv

VIRTUALVENV provides a specific Python virtual environment (sandbox) so that scripts that require a specific version of the module can run smoothly.

Because in virtualvenv, we can use

Pip Install-r requirements.txt

To install the dependent library for the script.

Next, say more about the installation method:

1. Enter cmd, execute the following command, the installation is successful

2. Create a virtualenv project

2.1 First create a folder myvirtualenv, specifically placed a different venv, and then CD into this folder;

2.2 Enter the following command, Venv_name for the name of the virtual environment you want to create, self-prepared, after the return of the directory will be more than Venv_name folder, is the virtual environment you create.

Virtualenv Venv_name

   

3. Enter VENV Virtual Environment

Run the following command to enter the Venv_name virtual environment, and then use the PIP list to view the pre-installed libraries for that virtual environment

Venv_name\scripts\activate

  

4. Install the specified version of the dependent library

  You can use the pip Install module name = = version number to install

Of course, it's not really possible to install it one by one, too inefficient

We recommend using the following command to install a series of dependent libraries

Pip Install-r requirements.txt

Where did requirements.txt come from? This is a dependent library file of the script that the script author will provide, which contains all the libraries and version numbers of the author's bad environment

Of course, we can also make such a file ourselves, run the following command

Pip Freeze > Requirements.txt

Will create a requirements.txt in the current directory, open the information after we just pip list results

  

Let's open it up, except for the Pip,wheel two.

  

5. Exit the current VENV virtual environment

Execute the following command

Deactivate

  

6. Delete the VENV virtual environment

This does not require a command, directly delete the Venv_name folder that you just created automatically.

Installation and use of the Flask virtualvenv (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.