Installer uv : venv Python, uv pip et uv run plus rapide que pip
venv, uv pip et uv run pour un Python plus rapide que pip seul.
Bootstrapping Python still means slow python -m venv, sluggish pip install, and laptops that disagree with CI. uv from Astral (the Ruff team) is a Rust-based toolchain for interpreters, virtualenvs, and installs — often an order of magnitude faster than plain pip.
Searchers looking for installer uv gestionnaire Python venv pip plus rapide need: install the uv CLI, create a venv with uv venv, install packages via uv pip, and run scripts with uv run. Follow docs.astral.sh/uv.
Who uv helps
Devs on many Python repos
uv venv spins up .venv quickly; uv pip install -r requirements.txt beats tuning pip mirrors every week.
Teams aligning laptops and CI
uv.lock plus uv sync (with pyproject.toml) makes deps diffable; start with uv pip if you still live on requirements files.
Migrating from pip/Poetry gradually
Pip-compatible subcommands mean you do not rewrite the whole stack on day one.
Install uv (macOS / Linux)
- 1
Official installer
Run the Getting Started command, e.g.
curl -LsSf https://astral.sh/uv/install.sh | sh. Open a new terminal and checkuv --version. - 2
macOS: Homebrew
brew install uvis documented. Pick one install path so PATH does not hide duplicate binaries. - 3
Linux / WSL
Prefer install.sh; verify with
which uvanduv --version. - 4
Optional: pin Python with uv
uv python install 3.12downloads a managed interpreter — see the Python versions page on the docs.
Create and use a virtualenv
- 1
uv venvFrom the project root:
uv venvcreates.venv. Pass--python 3.12when you need a specific line. - 2
Activate (optional)
source .venv/bin/activateon macOS/Linux. Many workflows skip manual activate and useuv runinstead. - 3
Verify
uv run python -Vshould report the project interpreter inside.venv.
Install packages with uv pip
uv pip install httpx
uv pip install -r requirements.txt
uv pip install -e .Global caching and parallel resolution usually beat bare pip on repeat installs. Configure private indexes per the docs (UV_INDEX_URL, etc.).
Run scripts faster with uv run
- 1
Project commands
uv run python main.pyoruv run pytestpicks the project environment when.venvorpyproject.tomlexists. - 2
One-off tools
uv run --with ruff ruff check .pulls ephemeral tools without polluting global site-packages (see Running scripts). - 3
Lockfile projects
uv syncthenuv run …for repos withpyproject.tomlanduv.lock.
| Job | pip habit | uv |
|---|---|---|
| venv | python -m venv .venv | uv venv |
| install | pip install pkg | uv pip install pkg |
| run | activate + python app.py | uv run python app.py |
uv speeds local and CI installs; production containers still need explicit Python base-image pins in Dockerfiles.
To pair on dependency errors, open a browser room from the accueil wbroom — créer une salle.
Questions worth checking
Does uv replace the system Python?
No. uv manages interpreters and virtualenvs for projects; the OS /usr/bin/python3 stays untouched. Run uv python list to see uv-managed versions.
I only have requirements.txt — need pyproject.toml?
Not immediately. uv pip install -r requirements.txt inside .venv works fine. Adopt pyproject.toml and uv sync when you want lockfiles — see the Projects docs on docs.astral.sh.
Can uv live beside pip, Poetry, or conda?
Yes globally, but pick one workflow per repo. Multiple tools writing the same venv path causes drift. Document “uv + .venv” in the README.
CI with uv?
Install uv in the job (install script or official action), run uv sync --frozen or uv pip install -r requirements.txt, then uv run pytest. Never print private index tokens in logs.