Create a virtual environment for Python2 and Python3 virtualenv

Source: Internet
Author: User
Tags virtual environment virtualenv

First of all to install on the computer Python2 and Python3 (can refer to my article: http://www.cnblogs.com/tk2049jq/p/7043480.html)

    1. Install Python2 and 3 in turn virtualenv and Virtualenvwrapper-win (using PIP2 and PIP3 respectively, we recommend using the Watercress Image: Pip2 Install *-I https://pypi.douban.com /simple)
    2. Modify the mkvirtualenv under Python2 and 3\scripts: Change to Mkvirtualenv2 and Mkvirtualenv3 respectively (rmvirtualenv, Workon also change, When it's easy to create and use, remind yourself of what the environment is.
    3. Delete the virtual environment for Python (typically under the C:\Users\ user name) in the virtual environment, leaving the corresponding Python version (the Python version to remind yourself of the virtual environment)
    4. This installs successfully, you can use MKVIRTUALENV2/3 to create a different Python virtual environment, then use WORKON2/3 for environment switch, RMVIRTUALENV2/3 Delete environment, deactivate exit environment
    5. When installing the module, be careful to distinguish between using PIP2 and PIP3

Python2 and Python3 have been pre-installed under ubuntu16.04 So just configure the virtual environment: I recommend using Python's python-venv module to install different virtual environments

1. Installing python2/3-venv
Apt-get Install Python2/3-venv

2. Create a virtual environment, test the name of the folder where the virtual environment resides
~/documents# PYTHON2/3-M venv test

3. Activate the virtual Environment source activate (to enter the installation directory: /test/bin/)

4. Exit the virtual Environment deactivate

Create a virtual environment for Python2 and Python3 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.