Python 3 Creating a virtual environment using VENV

Source: Internet
Author: User
Tags virtual environment

Python more than 3.3 uses venv instead of the original Python2 used to create the VIRTUALENV virtual environment.

The purpose of the virtual environment is to make the python packages of different projects not interfere with each other and avoid the problems arising from them.

Now demonstrate how to create a virtual environment on the desktop

c:\users\dell\desktop>mkdir python3venvtestc:\users\dell\desktop>CD python3venvtestc:\users\ Dell\desktop\python3venvtest>python-m venv test

This creates a virtual environment named Test that is not recommended to install too many third-party modules on native Python because the packages in the virtual environment are Python copied from the computer itself.

The test directory has three folders include,lib,scripts, one file pyvenv.cfg.

The way to start the virtual environment is to:

c:\users\dell\desktop\python3venvtest>test\scripts\activate.bat (test) C:\Users\dell\Desktop\ Python3venvtest>

Then, as with the usual steps to install the Python package, use PIP install xxxx to install the package you need.

The way to exit a virtual environment is:

(test) C:\users\dell\desktop\python3venvtest>Test\scripts\deactivate.batc:\users\dell\desktop\python3venvtest >

This will exit the virtual environment, the next time you want to enter the virtual environment in the corresponding path input command Activate.bat can enter.

Python 3 Creating a virtual environment using VENV

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.