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.