venv vs virtualenv vs uv venv
Three tools create the same thing: a directory with a pyvenv.cfg, interpreter links and a private site-packages. They differ in speed, in what they put inside, and in how they find the interpreter to use.
python -m venv |
virtualenv |
uv venv |
|
|---|---|---|---|
| Ships with | Python itself (3.3+) | pip install virtualenv (or pipx/uv tool) |
uv |
| Seeds pip? | yes (via ensurepip, slow-ish) |
yes, from a cached "app data" copy (fast); --no-pip to skip |
no by default; --seed adds pip |
| Pick another Python | run it with that Python: python3.12 -m venv |
-p 3.12 / --python discovery |
--python 3.12 (finds or, if allowed, downloads it) |
| Activation scripts | bash/zsh, csh, fish, PowerShell | + nushell, xonsh, activate_this.py |
same set as virtualenv |
| Extras | none | plugin system, Python 2 era features | very fast; used internally by uv sync |
All three, side by side
echo "--- python -m venv"
python3 -m venv a && ls a/bin && ls a/lib/python3.13/site-packages
echo "--- virtualenv"
virtualenv -q b && ls b/bin && ls b/lib/python3.13/site-packages | grep -v -e '^_' -e distutils
echo "--- uv venv"
uv venv -q c && ls c/bin && ls c/lib/python3.13/site-packages--- python -m venv
Activate.ps1
activate
activate.csh
activate.fish
pip
pip3
pip3.13
python
python3
python3.13
pip
pip-26.2.2.dist-info
--- virtualenv
activate
activate.csh
activate.fish
activate.nu
activate.ps1
activate.xsh
activate_this.py
deactivate.csh
pip
pip-3.13
pip3
pip3.13
python
python3
python3.13
pip
pip-26.2.2.dist-info
pip-26.2.2.virtualenv
--- uv venv
activate
activate.bat
activate.csh
activate.fish
activate.nu
activate.ps1
activate.xsh
activate_this.py
deactivate.bat
pydoc.bat
python
python3
python3.13
The uv venv environment has no pip at all. That is deliberate: in a uv workflow you install with uv pip install or uv sync, which work from outside the environment, so carrying pip in every environment is wasted space and time. Instead, uv installs into the environment from the outside:
uv venv -q c
c/bin/python -m pip --version 2>&1
uv pip install -q --python c attrs==26.1.0
c/bin/python -c 'import attrs; print("attrs", attrs.__version__)'
echo "--- asking for pip with --seed"
uv venv -q --seed d 2>&1/home/learner/c/bin/python: No module named pip
attrs 26.1.0
--- asking for pip with --seed
error: Failed to install seed packages into virtual environment
cause: No solution found when resolving: `pip`
cause: Because pip was not found in the package registry and you require pip, we can conclude that your requirements are unsatisfiable.
If a tool really needs pip inside the environment (some IDEs, pip install -e muscle memory), uv venv --seed installs it. Unlike python -m venv, which copies the pip wheel bundled with Python, uv fetches pip from the package index, and this course's offline index doesn't carry pip, hence the error. Against PyPI it just works.
The config files differ a little
virtualenv -q b && cat b/pyvenv.cfg
echo "---"
uv venv -q c && cat c/pyvenv.cfghome = /opt/python/bin
implementation = CPython
python-version = 3.13
version_info = 3.13.17.final.0
version = 3.13.17
executable = /opt/python/bin/python3.13
command = /opt/pytools/bin/python3 -m virtualenv /home/learner/b
virtualenv = 21.14.13
include-system-site-packages = false
base-prefix = /opt/python
base-exec-prefix = /opt/python
base-executable = /opt/python/bin/python3.13
---
home = /opt/python/bin
implementation = CPython
uv = 0.13.5
version_info = 3.13.17
include-system-site-packages = false
Both write extra keys (virtualenv = …, uv = …) so tools can tell who made the environment, and base-prefix/base-executable hints. Python itself only needs home and include-system-site-packages.
Picking an interpreter
python -m venv always uses the interpreter that runs it. virtualenv -p and uv venv --python search for one: on PATH, in pyenv-style install folders, in uv's managed installs. This container has only CPython 3.13, so asking for 3.12 fails, and uv explains that it would normally download one but downloads are disabled here:
uv venv --python 3.12 old 2>&1
echo "---"
virtualenv -q -p 3.12 old 2>&1 | head -1
echo "---"
uv venv --python 3.13 ok 2>&1error: No interpreter found for Python 3.12 in managed installations or search path
hint: A managed Python download is available for Python 3.12, but Python downloads are set to 'never'
---
RuntimeError: failed to find interpreter for Builtin discover of python_spec='3.12'
---
Using CPython 3.13.17 interpreter at: /usr/local/bin/python3.13
Creating virtual environment at: ok
Activate with: source ok/bin/activate
The uv python lesson covers interpreter management in more depth.
Which one should you use?
- Scripts, Dockerfiles, CI with no extra tools:
python -m venv .venv. It's always there. - You already use uv:
uv venv, or don't create one at all, sinceuv syncanduv runcreate.venvon demand. - virtualenv is mostly a dependency now: tox, nox, hatch and pipx use it (or uv) to make their environments quickly. You rarely call it by hand, but its
-pdiscovery is handy when you juggle many interpreters without uv.
Test yourself
Why does an environment created with uv venv contain no pip?
- uv can't install pip
- uv installs packages from outside the environment (
uv pip install,uv sync), so pip isn't needed;--seedadds it - pip is incompatible with uv
- It's a bug
How do you create a venv for Python 3.12 with the standard library module?
- python -m venv --python 3.12 .venv
- Run the module with that interpreter: python3.12 -m venv .venv
- venv can't do that
- python -m venv -p 3.12 .venv