mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-19 11:15:01 +00:00

Some checks are pending
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on linux (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on opensuse (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86_64 (push) Blocked by required conditions
CI / check system | python3.10 on windows (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on linux (push) Blocked by required conditions
CI / check system | conda3.8 on linux (push) Blocked by required conditions
CI / check system | conda3.11 on macos (push) Blocked by required conditions
CI / check system | conda3.8 on macos (push) Blocked by required conditions
CI / check system | conda3.11 on windows (push) Blocked by required conditions
CI / check system | conda3.8 on windows (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
## Summary Was reading through some of the docs and noticed this small typo in https://docs.astral.sh/uv/pip/packages/#editable-packages ## Test Plan Not applicable
122 lines
2.5 KiB
Markdown
122 lines
2.5 KiB
Markdown
# Managing packages
|
|
|
|
## Installing a package
|
|
|
|
To install a package into the virtual environment, e.g., Flask:
|
|
|
|
```console
|
|
$ uv pip install flask
|
|
```
|
|
|
|
To install a package with optional dependencies enabled, e.g., Flask with the "dotenv" extra:
|
|
|
|
```console
|
|
$ uv pip install "flask[dotenv]"
|
|
```
|
|
|
|
To install multiple packages, e.g., Flask and Ruff:
|
|
|
|
```console
|
|
$ uv pip install flask ruff
|
|
```
|
|
|
|
To install a package with a constraint, e.g., Ruff v0.2.0 or newer:
|
|
|
|
```console
|
|
$ uv pip install 'ruff>=0.2.0'
|
|
```
|
|
|
|
To install a package at a specific version, e.g., Ruff v0.3.0:
|
|
|
|
```console
|
|
$ uv pip install 'ruff==0.3.0'
|
|
```
|
|
|
|
To install a package from the disk:
|
|
|
|
```console
|
|
$ uv pip install "ruff @ ./projects/ruff"
|
|
```
|
|
|
|
To install a package from GitHub:
|
|
|
|
```console
|
|
$ uv pip install "git+https://github.com/astral-sh/ruff"
|
|
```
|
|
|
|
To install a package from GitHub at a specific reference:
|
|
|
|
```console
|
|
$ # Install a tag
|
|
$ uv pip install "git+https://github.com/astral-sh/ruff@v0.2.0"
|
|
|
|
$ # Install a commit
|
|
$ uv pip install "git+https://github.com/astral-sh/ruff@1fadefa67b26508cc59cf38e6130bde2243c929d"
|
|
|
|
$ # Install a branch
|
|
$ uv pip install "git+https://github.com/astral-sh/ruff@main"
|
|
```
|
|
|
|
See the [Git authentication](../configuration/authentication.md#git-authentication) documentation
|
|
for installation from a private repository.
|
|
|
|
## Editable packages
|
|
|
|
Editable packages do not need to be reinstalled for changes to their source code to be active.
|
|
|
|
To install the current project as an editable package
|
|
|
|
```console
|
|
$ uv pip install -e .
|
|
```
|
|
|
|
To install a project in another directory as an editable package:
|
|
|
|
```console
|
|
$ uv pip install -e "ruff @ ./project/ruff"
|
|
```
|
|
|
|
## Installing packages from files
|
|
|
|
Multiple packages can be installed at once from standard file formats.
|
|
|
|
Install from a `requirements.txt` file:
|
|
|
|
```console
|
|
$ uv pip install -r requirements.txt
|
|
```
|
|
|
|
See the [`uv pip compile`](./compile.md) documentation for more information on `requirements.txt`
|
|
files.
|
|
|
|
Install from a `pyproject.toml` file:
|
|
|
|
```console
|
|
$ uv pip install -r pyproject.toml
|
|
```
|
|
|
|
Install from a `pyproject.toml` file with optional dependencies enabled, e.g., the "foo" extra:
|
|
|
|
```console
|
|
$ uv pip install -r pyproject.toml --extra foo
|
|
```
|
|
|
|
Install from a `pyproject.toml` file with all optional dependencies enabled:
|
|
|
|
```console
|
|
$ uv pip install -r pyproject.toml --all-extras
|
|
```
|
|
|
|
## Uninstalling a package
|
|
|
|
To uninstall a package, e.g., Flask:
|
|
|
|
```console
|
|
$ uv pip uninstall flask
|
|
```
|
|
|
|
To uninstall multiple packages, e.g., Flask and Ruff:
|
|
|
|
```console
|
|
$ uv pip uninstall flask ruff
|
|
```
|