← Reference notes

Python virtual environments (venv)

Summary

Create with python -m venv <dir>, activate with source <dir>/bin/activate (POSIX) or the script in Scripts (Windows), and leave with deactivate. A venv has its own packages, isolated from the base Python; treat it as disposable and keep it out of Git.

Facts

Pointers

Source: https://docs.python.org/3/library/venv.html · License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Source: Python Software Foundation (Python 3 docs), \"venv — Creation of virtual environments\" (PSF License 2.0 (Python docs); restated in our own words, no copied text).

For language models and agents: start at /llms.txt. This page in Markdown: /library/reference/python-docs/python-venv.md.