Virtual Environments (Python)

Virtual environments allow you to develop in a clean slate, leaving nothing to global packages and allowing easy installation by others.

You are in a virtual environment for your Python project when you see the env name (in this case, literally env) to the left of the bash prompt.

Create

cd to project folder and then type:

python3 -m venv env

Activate

cd to project folder and then type:

source env/bin/activate

Deactivate

deactivate

Last modified: 202107020544