What is venv?
Venv is a python module that support a python environment
Why use venv?
While using venv is not a necessity, it can be quiet helpful. For example, if you have a project to work on with a certain version and want to use another, unsure if it will be more suitable for what you are working on, you can use a virtual environment to set up and test things out, without ruining your original workspace/project
When to use venv?
You can use venv whenever you think it is fit to experiment in a “sandbox” environment
How to install venv:
Note: make sure your preferred version of python is loaded
module load python
navigate to wherever in the filesystem you want the venv to be located
Create the venv:
python -m venv <name of venv here>
And Finally, activate the venv:
source <path to where you created the venv>/<name of venv here>/bin/activate
Now you can install whatever you'd like with pip!
Be sure to include the 'source' step in any scripts that will need to use the packages installed in the newly created venv.