what is python virtual environment

python3 -m venv env
python -m virtualenv env #py2

source env/bin/activate

#all this is on same directory

Here is what the above code is Doing:
1. Creating a virtual environment named env.
2. Activating the virtual environment.
3. Installing the required packages in the virtual environment.
4. Deactivating the virtual environment.