Installing Virtualenv
Install virtualenv
If the download is slow, you can add a watercress source:
Install -I https:///pypi.douban.com/simple/virtualenv
It is also possible to download other packages using a watercress source.
To create a virtual environment using virtualenv:
Virtualenv -p/pah/to/your/python/Environment name
Operating Environment:
Source Activate Environment name
To exit the environment simply enter the following code in the environment:
Deactivate
Manage virtual environments with Mkvirtualenv:
Install Virtualenvwrapper
Configuring the Workon Path
Add the following code in ~/.BASHRC:
Export Workon_home = $HOME//your/path/to/virtualenvwrapper. SH
You can find the virtualenvwrapper.sh path by using the following code:
sudo Find /-name virtualenvwrapper. SH
Use the following code to make the Workon configuration effective:
SOURCE ~/.BASHRC
Then start the environment simply by following the code:
Workon Environment Name
See all built environments:
Workon
Create a virtual Environment from MKVIRTUALENV:
Mkvirtualenv--python =/your/python/pah/Environment name
Or
MKVIRTUALENV-P/your/path/to/python Environment Name
Recommend a Python environment management tool pyenv, with this tool to control the Python version, but also simplifies the configuration of the virtual environment, pyenv installation configuration can refer to my essay
An example of using virtualenvwrapper after configuring a python version with pyenv:
MKVIRTUALENV Environment Name
is not a lot of simple, I hope this article is helpful to you, thank you.
Ubuntu Installation and Configuration Virtualenv,virtualenvwrapper