Files
uv/docs/getting-started/installation.md
T

105 lines
2.6 KiB
Markdown
Raw Normal View History

2024-06-26 12:28:42 -04:00
# Installing uv
2024-08-05 09:54:06 -04:00
Install uv with our standalone installers or your package manager of choice (e.g.,
`pip install uv`).
2024-06-26 12:28:42 -04:00
## Standalone installer
2024-08-05 09:54:06 -04:00
uv provides a standalone installer to download and install uv:
2024-06-26 12:28:42 -04:00
2024-08-03 08:41:33 -05:00
```console title="macOS and Linux"
$ curl -LsSf https://astral.sh/uv/install.sh | sh
```
2024-06-26 12:28:42 -04:00
2024-08-03 08:41:33 -05:00
```console title="Windows"
$ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
2024-06-26 12:28:42 -04:00
```
2024-08-05 09:54:06 -04:00
By default, uv is installed to `~/.cargo/bin`.
2024-06-26 12:28:42 -04:00
2024-07-24 18:10:33 -04:00
!!! tip
2024-08-03 08:41:33 -05:00
The installation script may be inspected before use:
2024-08-03 08:41:33 -05:00
```console title="macOS and Linux"
$ curl -LsSf https://astral.sh/uv/install.sh | less
```
2024-08-03 08:41:33 -05:00
```console title="Windows"
$ powershell -c "irm https://astral.sh/uv/install.ps1 | more"
```
Alternatively, the installer or binaries can be downloaded directly from [GitHub](#github-releases).
2024-08-03 08:41:33 -05:00
Request a specific version by including it in the URL:
2024-06-26 12:28:42 -04:00
2024-08-03 08:41:33 -05:00
```console title="macOS and Linux"
$ curl -LsSf https://astral.sh/uv/0.2.11/install.sh | sh
```
2024-06-26 12:28:42 -04:00
2024-08-03 08:41:33 -05:00
```console title="Windows"
$ powershell -c "irm https://astral.sh/uv/0.2.11/install.ps1 | iex"
2024-06-26 12:28:42 -04:00
```
2024-08-03 08:41:33 -05:00
!!! tip
2024-06-26 12:28:42 -04:00
2024-08-05 09:54:06 -04:00
When uv is installed via the standalone installer, self-updates are enabled:
2024-08-03 08:41:33 -05:00
```console
$ uv self update
```
2024-06-26 12:28:42 -04:00
2024-08-03 08:41:33 -05:00
When another installation method is used, self-updates are disabled. Use the package manager's
upgrade method instead.
2024-06-26 12:28:42 -04:00
## PyPI
2024-07-17 10:29:02 -04:00
For convenience, uv is published to [PyPI](https://pypi.org/project/uv/).
2024-06-26 12:28:42 -04:00
2024-07-22 13:15:11 -04:00
If installing from PyPI, we recommend installing uv into an isolated environment, e.g., with `pipx`:
2024-06-26 12:28:42 -04:00
2024-08-03 08:41:33 -05:00
```console
$ pipx install uv
2024-06-26 12:28:42 -04:00
```
However, `pip` can also be used:
2024-08-03 08:41:33 -05:00
```console
$ pip install uv
2024-06-26 12:28:42 -04:00
```
2024-07-22 13:15:11 -04:00
!!! note
2024-08-05 09:54:06 -04:00
uv ships with prebuilt distributions (wheels) for many platforms; if a wheel is not available for a given
platform, uv will be built from source, which requires a Rust toolchain. See the
[contributing setup guide](https://github.com/astral-sh/uv/blob/main/CONTRIBUTING.md#setup)
for details on building uv from source.
2024-07-17 10:29:02 -04:00
2024-06-26 12:28:42 -04:00
## Homebrew
uv is available in the core Homebrew packages.
2024-08-03 08:41:33 -05:00
```console
$ brew install uv
2024-06-26 12:28:42 -04:00
```
## Docker
uv provides a Docker image at
[`ghcr.io/astral-sh/uv`](https://github.com/astral-sh/uv/pkgs/container/uv).
2024-06-26 12:28:42 -04:00
See our guide on [using uv in Docker](../guides/integration/docker.md) for more details.
## GitHub Releases
uv release artifacts can be downloaded directly from
[GitHub Releases](https://github.com/astral-sh/uv/releases).
Each release page includes binaries for all supported platforms as well as instructions for using
the standalone installer via `github.com` instead of `astral.sh`.
## Next steps
See the [first steps](./first-steps.md) or jump straight to the [guides](../guides/index.md) to
start using uv.