Virtual environment

A virtual environment has its own installation of Python and libraries, keeping dependencies separate from other projects.

Install

Create a virtual environment if one doesn't exist.

[[ -d ".venv" ]] || python -m venv .venv

Activate it.

. .venv/bin/activate

Upgrade pip.

pip install --upgrade pip
Poetry

Poetry automatically creates and activates virtual environments.

Virtual environment
Interactive graph
On this page
Install