tn-venv
Create Python virtual environments with one command — batteries included.
tn-venv is a zero-dependency, batteries-included replacement for
python -m venv that picks rigorous, predictable defaults: running bare
tn-venv creates ./.venv from the current interpreter, installs pip,
writes activation scripts for every major shell, and records exactly how the
environment was made.
$ tn-venv
==> creating virtual environment at ./.venv
interpreter: cpython 3.14.7 (64-bit) from C:\Python314\python.exe
==> installing pip (ensurepip)
==> environment ready: .\.venv\Scripts\python.exe
Feature tour
Running bare tn-venv creates ./.venv with the current interpreter and
pip pre-installed. No flags required — every knob has a defensible default.
-p accepts a path, a version (3.12), a command name (python3.12), or an
implementation (pypy3.10). Interpreters are located via PATH, the
Windows registry,
the py launcher, uv, and pyenv.
pip is installed through ensurepip; it can then be pinned
(--pip 24.0), upgraded (--upgrade-pip), or joined by setuptools,
wheel, extra packages (--with), and requirement files (-r).
Activation scripts are generated for bash/zsh, cmd.exe, PowerShell, fish, csh/tcsh, Nushell, and the legacy activate_this.py — all in one pass.
Every option is settable from the CLI, from TN_VENV_* environment
variables, or from pyproject.toml / tn-venv.ini, with documented
precedence.
Creation runs under an inter-process lock,
fails cleanly on existing environments, and never touches the network unless
you ask it to (--offline).
Where to next
I want to… |
Read |
|---|---|
Install and create my first environment |
|
Understand every CLI flag |
|
Configure defaults per project |
|
Pick a specific Python |
|
Seed packages offline |
|
Embed tn-venv in Python code |
|
Compare with venv / virtualenv / uv |
|
Hack on tn-venv itself |