uv installieren: Python-venv, uv pip und schneller als pip mit uv run

Mit uv venv, uv pip und uv run schneller als mit barem pip.

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 uv Python Paketmanager installieren venv pip schneller 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.

Install uvuv venv · activateuv pip · uv run

Who uv helps

01

Devs on many Python repos

uv venv spins up .venv quickly; uv pip install -r requirements.txt beats tuning pip mirrors every week.

02

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.

03

Migrating from pip/Poetry gradually

Pip-compatible subcommands mean you do not rewrite the whole stack on day one.

Install uv (macOS / Linux)

  1. 1

    Official installer

    Run the Getting Started command, e.g. curl -LsSf https://astral.sh/uv/install.sh | sh. Open a new terminal and check uv --version.

  2. 2

    macOS: Homebrew

    brew install uv is documented. Pick one install path so PATH does not hide duplicate binaries.

  3. 3

    Linux / WSL

    Prefer install.sh; verify with which uv and uv --version.

  4. 4

    Optional: pin Python with uv

    uv python install 3.12 downloads a managed interpreter — see the Python versions page on the docs.

Create and use a virtualenv

  1. 1

    uv venv

    From the project root: uv venv creates .venv. Pass --python 3.12 when you need a specific line.

  2. 2

    Activate (optional)

    source .venv/bin/activate on macOS/Linux. Many workflows skip manual activate and use uv run instead.

  3. 3

    Verify

    uv run python -V should 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. 1

    Project commands

    uv run python main.py or uv run pytest picks the project environment when .venv or pyproject.toml exists.

  2. 2

    One-off tools

    uv run --with ruff ruff check . pulls ephemeral tools without polluting global site-packages (see Running scripts).

  3. 3

    Lockfile projects

    uv sync then uv run … for repos with pyproject.toml and uv.lock.

Jobpip habituv
venvpython -m venv .venvuv venv
installpip install pkguv pip install pkg
runactivate + python app.pyuv 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 wbroom-Startseite — Raum erstellen.

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.

Meeting starten