Installation | uv (original) (raw)
Installing uv
Installation methods
Install uv with our standalone installers or your package manager of choice.
Standalone installer
uv provides a standalone installer to download and install uv:
macOS and LinuxWindows
Use curl
to download the script and execute it with sh
:
[](#%5F%5Fcodelineno-0-1)$ curl -LsSf https://astral.sh/uv/install.sh | sh
If your system doesn't have curl
, you can use wget
:
[](#%5F%5Fcodelineno-1-1)$ wget -qO- https://astral.sh/uv/install.sh | sh
Request a specific version by including it in the URL:
[](#%5F%5Fcodelineno-2-1)$ curl -LsSf https://astral.sh/uv/0.7.13/install.sh | sh
Use irm
to download the script and execute it with iex
:
[](#%5F%5Fcodelineno-3-1)PS> powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Changing the execution policy allows running a script from the internet.
Request a specific version by including it in the URL:
[](#%5F%5Fcodelineno-4-1)PS> powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/0.7.13/install.ps1 | iex"
Tip
The installation script may be inspected before use:
macOS and LinuxWindows
[](#%5F%5Fcodelineno-5-1)$ curl -LsSf https://astral.sh/uv/install.sh | less
[](#%5F%5Fcodelineno-6-1)PS> powershell -c "irm https://astral.sh/uv/install.ps1 | more"
Alternatively, the installer or binaries can be downloaded directly from GitHub.
See the reference documentation on the installer for details on customizing your uv installation.
PyPI
For convenience, uv is published to PyPI.
If installing from PyPI, we recommend installing uv into an isolated environment, e.g., with pipx
:
However, pip
can also be used:
Note
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 thecontributing setup guidefor details on building uv from source.
Cargo
uv is available via Cargo, but must be built from Git rather than crates.io due to its dependency on unpublished crates.
[](#%5F%5Fcodelineno-9-1)$ cargo install --git https://github.com/astral-sh/uv uv
Homebrew
uv is available in the core Homebrew packages.
WinGet
uv is available via WinGet.
[](#%5F%5Fcodelineno-11-1)$ winget install --id=astral-sh.uv -e
Scoop
uv is available via Scoop.
Docker
uv provides a Docker image atghcr.io/astral-sh/uv.
See our guide on using uv in Docker for more details.
GitHub Releases
uv release artifacts can be downloaded directly fromGitHub 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:
Tip
Updating uv will re-run the installer and can modify your shell profiles. To disable this behavior, set INSTALLER_NO_MODIFY_PATH=1
.
When another installation method is used, self-updates are disabled. Use the package manager's upgrade method instead. For example, with pip
:
[](#%5F%5Fcodelineno-14-1)$ pip install --upgrade uv
Shell autocompletion
Tip
You can run echo $SHELL
to help you determine your shell.
To enable shell autocompletion for uv commands, run one of the following:
BashZshfishElvishPowerShell / pwsh
[](#%5F%5Fcodelineno-15-1)echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc
[](#%5F%5Fcodelineno-16-1)echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
[](#%5F%5Fcodelineno-17-1)echo 'uv generate-shell-completion fish | source' > ~/.config/fish/completions/uv.fish
[](#%5F%5Fcodelineno-18-1)echo 'eval (uv generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv
[](#%5F%5Fcodelineno-19-1)if (!(Test-Path -Path $PROFILE)) { [](#%5F%5Fcodelineno-19-2) New-Item -ItemType File -Path $PROFILE -Force [](#%5F%5Fcodelineno-19-3)} [](#%5F%5Fcodelineno-19-4)Add-Content -Path $PROFILE -Value '(& uv generate-shell-completion powershell) | Out-String | Invoke-Expression'
To enable shell autocompletion for uvx, run one of the following:
BashZshfishElvishPowerShell / pwsh
[](#%5F%5Fcodelineno-20-1)echo 'eval "$(uvx --generate-shell-completion bash)"' >> ~/.bashrc
[](#%5F%5Fcodelineno-21-1)echo 'eval "$(uvx --generate-shell-completion zsh)"' >> ~/.zshrc
[](#%5F%5Fcodelineno-22-1)echo 'uvx --generate-shell-completion fish | source' > ~/.config/fish/completions/uvx.fish
[](#%5F%5Fcodelineno-23-1)echo 'eval (uvx --generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv
[](#%5F%5Fcodelineno-24-1)if (!(Test-Path -Path $PROFILE)) { [](#%5F%5Fcodelineno-24-2) New-Item -ItemType File -Path $PROFILE -Force [](#%5F%5Fcodelineno-24-3)} [](#%5F%5Fcodelineno-24-4)Add-Content -Path $PROFILE -Value '(& uvx --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, follow these steps:
$ rm -r "$(uv tool dir)" Tip Before removing the binaries, you may want to remove any data that uv has stored. 2. Remove the uv and uvx binaries: macOS and LinuxWindows
$ rm /.local/bin/uv ~/.local/bin/uvx/.cargo/bin
PS> rm $HOME.local\bin\uv.exe
PS> rm $HOME.local\bin\uvx.exe Note Prior to 0.5.0, uv was installed into
. The binaries can be removed from there to uninstall. Upgrading from an older version will not automatically remove the binaries from
~/.cargo/bin`.
Next steps
See the first steps or jump straight to the guides to start using uv.