This is a compressed cheat sheet for venv:
python3 -m venv path/to/env
Creates a new environment in a specific folder, using current python interpreter (
python3). It’s not activated by default.
You might need to install it first on distros that don’t have it by default i.e.
apt install python3-venv.
To use that environment, you need to activate it.
On Linux, you would run
activate script form the
bin folder in that env:
A hint it’s active is prompt change in most of the shells i.e. bash:
venv usually does not create
bin folder but
Scripts and you can run
On Linux, execute
deactivate. In fact, this also works on Windows as well, due to some trickery venv adds to
Have a question⁉ Contact me.