Virtual Environment (venv)

Linux

I sometimes forget how to create a virtual environment when workinng on something.

To create a venv on Linux:

python3 -m venv venv

To activate the venv:

source venv/bin/activate

To deactivate the venv:

deactivate

Create a venv for a particular python version

Just specify the version number that's all.

python3.10 -m venv venv