Python virtual environments

Keep every project's packages to itself.

SNP 028 #945 Filed python

Create one in the project folder, activate it and install things into it:

shell
python3 -m venv .venv
source .venv/bin/activate
pip install requests

On Windows the activation is .venv\Scripts\activate.

Save what you installed so others (and future you) can recreate it:

shell
pip freeze > requirements.txt
pip install -r requirements.txt

deactivate gets you out. Add .venv/ to your .gitignore.