Python virtualenv or venv are the short forms of virtual environment.
Virtualenv is useful for different projects with unique requirements for each of them, like versions of python or at least different versions of Python libraries.
So they run parallel on a same system in separated from each other environments without any conflicts between them.
Some straight forward examples on macOS:
pip3 install virtualenv
To make a virtual environment:
# make a virtual environment with special python version
virtualenv -p /usr/bin/python2.7 venv
Activate the created virtual environment:
Freeze environment packages:
pip freeze –local > requirements.txt
Install early freezed packages:
pip install -r requirements.txt
To get out of your virtual environment, simple type: