Virtual environments and Python version management
coreintermediateA virtual environment isolates a project's installed packages. A Python version manager goes one level further, isolating the interpreter itself, so one project can use 3.10 while another uses 3.13 on the same machine.
Think of it as
A venv is a private toolbox for one project's packages. A version manager is having several different-sized wrenches available at all — the venv picks which toolbox, the version manager picks which wrench even exists to put in it.
What we're doing: Use uv to create a venv pinned to a specific Python version, showing environment and interpreter isolation working together.
- 1
- uv venv both selects a Python interpreter version AND creates a package-isolated environment for it, in one step.
Using CPython 3.11.15
Creating virtual environment at: .venv
Activate with: .venv\Scripts\activateWhy this works: uv reports exactly which interpreter it picked (3.11.15 here, from what was available on this machine) before creating the environment — making explicit the two separate concerns a venv alone does not cover: which Python, and which packages.
Assuming a venv changes the Python version available
Wrong
Better
What you see: A project declaring requires-python = ">=3.10,<3.11" still runs on 3.14 inside its venv, silently, because nothing actually enforces the version at venv-creation time without a version manager.
Why: python -m venv .venv always uses the SAME interpreter that ran the command — it copies references to that interpreter, never downloads a different one. Getting an actually different Python version requires a version manager (uv, pyenv) that can install one.
- Version manager — which interpreter exists at all
- uv python install 3.12 — fetches an interpreter build
- Python 3.10, 3.12, 3.14 — multiple versions, side by side
- Virtual environment — which packages, for one project
- uv venv --python 3.12 — inherits the chosen interpreter
- .venv/ — isolated packages, this project only
Remember: A venv isolates packages, inheriting whatever Python ran it; a version manager isolates the interpreter itself.
See also: pip and uv · pip and venv

