Different applications often use different versions of modules and packages .
In the virtual environment, we can only install the dependent packages required by the program , The virtual environments are isolated from each other , They don't influence each other .
python3 -m venv venv1 Create the directory where the virtual environment is located
source venv1/bin/activate Activate the virtual environment
rm -rf venv1 Delete virtual environment venv1
pip list View the installed libraries in the virtual environment
pip install xxx Install third party libraries
deactivate Exit virtual environment
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
source ~/.bashrc
pyenv virtualenv 3.7.10 venv2
pyenv activate venv2
Start using the environment
pyenv deactivate
rm -rf ~/.pyenv/versions/venv2