Introduction to Python Virtual environment virtualenv

Source: Internet
Author: User
Tags virtual environment virtualenv

Reference website: https://realpython.com/python-virtual-environments-a-primer/

First, create a new virtual environment

2:virtualenv my_new_virtualenv3. Python3 already have the Venv module from the standard library installedpython3-m venv my_new_virtualenv
Or
Virtualenv-p $ (which Python3) my_new_virtualenv

Start the virtual environment

CD .../python-virtual-environmentssource my_new_virtualenv/bin/activate

Turn off the virtual environment

Deactivate

Second, the virtual environment working principle

This section may refer to the following sections of the above Web site,

How Does a Virtual environment work?

The most important of these is that, in both environments, the Python executables store location $which python and environment variable $path $echo $PATH Different.

Iii. Virtualenvwrapper-Tools for managing multiple virtual environments

When we create multiple virtual environments, there are a lot of problems around how to manage these virtual environments, so Python provides a toolkit virtualenvwrapper for managing multiple virtual environments. A few useful features of the toolkit are listed below, please refer to the above website for details.

    • Organizes all of your virtual environments on one location
    • Provides methods to help you easily create, delete, and copy environments
    • Provides a single command to switch between environments

Introduction to Python Virtual environment virtualenv

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.