Examples of Python3 's virtualenvwrapper configuration under Linux

Source: Internet
Author: User
Tags virtualenv
Python version management &virtualenv management

Virtualenvwrapper is an extension pack for managing virtualenv, which is handy.

Note that in Python3, Pip is installed: sudo apt install python3-pip

Python2:sudo Apt Install Python2-pip

1.virtualenvwrapper Installation:

#安装virtualenv (sudo) pip install virtualenv# install virtualenvwrapper (sudo) pip install Virtualenvwrapper

2. Configuration:

Modify ~/.bash_profile or other environment variable related files (such as. BASHRC (This is under my Ubuntu15.10) or use ZSH. ZSHRC) and add the following statement:

Export workon_home= $HOME/.virtualenvsexport project_home= $HOME/workspacesource/usr/local/bin/ virtualenvwrapper.sh

Then run:

SOURCE ~/.bash_profile

3. Usage:

Mkvirtualenv ZQXT: Creating a Running environment ZQXT

Workon ZQXT: Working in a ZQXT environment or switching from another environment to a ZQXT environment

Deactivate : Exiting the terminal environment

Other:

rmvirtualenv ENV: Delete Running environment env

mkproject Mic: Create MIC Project and run environment mic

mktmpenv: Creating a temporary runtime environment

lsvirtualenv: List the available run environments

lssitepackages: Lists the packages that are installed in the current environment

Note: Multiple versions of Python can also be managed directly using pyenv , with 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.