Home > Backend Development > Python Tutorial > Example of python3's virtualenvwrapper configured under Linux

Example of python3's virtualenvwrapper configured under Linux

黄舟
Release: 2017-08-23 13:08:30
Original
1929 people have browsed it

Python version management & virtualenv management

virtualenvwrapper is an expansion package used to manage virtualenv, which is very convenient to use.

Note that in python3, the installation of pip: sudo apt install python3-pip

  python2:sudo apt install python2-pip

1.virtualenvwrapper installation:

#安装virtualenv
(sudo) pip install virtualenv

#安装virtualenvwrapper
(sudo) pip install virtualenvwrapper
Copy after login

2. Configuration:

Modify ~/.bash_profile or other environment variable-related files (such as .bashrc (this is the one under my Ubuntu15.10) or .zshrc after using ZSH), add The following statement:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/workspace
source /usr/local/bin/virtualenvwrapper.sh
Copy after login

Then run:

source ~/.bash_profile
Copy after login

3. Usage:

mkvirtualenv zqxt: Create a running environment zqxt

workon zqxt: Work in the zqxt environment or switch to the zqxt environment from other environments

deactivate: Exit the terminal environment

Others:

##rmvirtualenv ENV: Delete the running environment ENV

mkproject mic: Create a mic project and running environment mic

mktmpenv: Create a temporary running environment

lsvirtualenv: List the available running environments

lssitepackages: List the current environment Installed package

Note: You can also directly use pyenv for multi-version python management, with built-in virtualenv .

The above is the detailed content of Example of python3's virtualenvwrapper configured under Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template