Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the installation documentation page #6468

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 63 additions & 18 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Installing uv

Install uv with our standalone installers or your package manager of choice (e.g.,
`pip install uv`).
## Installation methods

## Standalone installer
Install uv with our standalone installers or your package manager of choice.

### Standalone installer

uv provides a standalone installer to download and install uv:

Expand Down Expand Up @@ -41,18 +42,7 @@ $ curl -LsSf https://astral.sh/uv/0.3.1/install.sh | sh
$ powershell -c "irm https://astral.sh/uv/0.3.1/install.ps1 | iex"
```

!!! tip

When uv is installed via the standalone installer, self-updates are enabled:

```console
$ uv self update
```

When another installation method is used, self-updates are disabled. Use the package manager's
upgrade method instead.

## PyPI
### PyPI

For convenience, uv is published to [PyPI](https://pypi.org/project/uv/).

Expand All @@ -75,29 +65,84 @@ $ pip install uv
[contributing setup guide](https://github.com/astral-sh/uv/blob/main/CONTRIBUTING.md#setup)
for details on building uv from source.

## Homebrew
### Homebrew

uv is available in the core Homebrew packages.

```console
$ brew install uv
```

## Docker
### Docker

uv provides a Docker image at
[`ghcr.io/astral-sh/uv`](https://github.com/astral-sh/uv/pkgs/container/uv).

See our guide on [using uv in Docker](../guides/integration/docker.md) for more details.

## GitHub Releases
### 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`.

## Upgrading uv

When uv is installed via the standalone installer, it can update itself on-demand:

```console
$ uv self update
```

When another installation method is used, self-updates are disabled. Use the package manager's
upgrade method instead. For example, with `pip`:

```console
$ pip install --upgrade uv
```

## Shell autocompletion

To enable shell autocompletion for uv commands, run one of the following:

=== "Linux and macOS"

```bash
# Determine your shell (e.g., with `echo $SHELL`), then run one of:
echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc
echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
echo 'uv generate-shell-completion fish | source' >> ~/.config/fish/config.fish
echo 'eval (uv generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv
```

=== "Windows"

```powershell
Add-Content -Path $PROFILE -Value '(& uv generate-shell-completion powershell) | Out-String | Invoke-Expression
```

Then restart the shell or source the shell config file.

## Uninstallation

If you need to remove uv from your system, just remove the `uv` and `uvx` binaries:

```console
$ rm ~/.cargo/bin/uv ~/.cargo/bin/uvx
```

!!! tip

You may want to remove data that uv has stored before removing the binaries:

```console
$ uv cache clean
$ rm -r "$(uv python dir)"
$ rm -r "$(uv tool dir)"
```

## Next steps

See the [first steps](./first-steps.md) or jump straight to the [guides](../guides/index.md) to
Expand Down
Loading