Python's Virtual Environment virtualenv

Source: Internet
Author: User

Original address: blog.sina.com.cn/s/blog_4ddef8f80101eu0w.html

Python's virtual environment allows a Python program to have a separate library and interpreter interpreter, without sharing a unified library and interpreter with other Python programs. The benefit of a virtual environment is to avoid the interaction between different Python programs (using the Global Library and interpreter), for example, program a requires a 1.0 version of a library, and program B needs the same 2.0 version of the library, and if program B executes then a cannot be executed.

Install virtualenv :
    pip Install virtualenv
Create a virtual environment
    virtualenv venv
     Venv is the name of the newly created virtual environment. It also creates a folder venv with the same name as the virtual environment, which stores a separate Python execution environment.
Enter virtual environment
    source venv/bin/activate
     After entering the virtual environment, the command line prompt will be added to the name of the virtual environment, for example: (venv) [email protected]:~$
Exiting a virtual environment $
    deactivate
Deleting a virtual environment
     Rm-r venv
     Delete the venv virtual environment we created by deleting the folder venv the virtual environment.

Details and virtualenvwrapper and autoenv please read:
http://docs.python-guide.org/en/latest/dev/virtualenvs/

Python's Virtual Environment virtualenv

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.