Skip to main content

uv tool install

Install commands provided by a Python package into an isolated environment.

Usage

Description

Packages are installed into an isolated virtual environment in the uv tools directory. The executables are linked to the tool executable directory, which is determined according to the XDG standard and can be retrieved with uv tool dir --bin. If the tool was previously installed, the existing tool will generally be replaced.
After installing a tool, you may need to add the tool executable directory to your PATH. Use uv tool update-shell to do this automatically.

Examples

Install a tool

Install a specific version

Install with version constraint

Install with extras

Install with additional dependencies

Install from Git

Install in editable mode

Force reinstall

Arguments

PACKAGE
string
required
The package to install commands from. Can be a package name, a package with version specifier, a URL, or a local path.

Options

Package Options

--from
string
The package to install commands from. This option is provided for parity with uv tool run, but is redundant with the PACKAGE argument.
-w, --with
string
Include additional requirements. Can be specified multiple times.
--with-requirements
file
Run with the packages listed in the given files. Supports requirements.txt, .py files with inline metadata, and pylock.toml.
-e, --editable
boolean
Install the target package in editable mode, such that changes in the package’s source directory are reflected without reinstallation.
--with-editable
path
Include the given packages in editable mode. Can be specified multiple times.
--with-executables-from
string
Install executables from the specified packages. This allows you to install commands from additional packages beyond the main package.

Constraints

-c, --constraint
file
Constrain versions using the given requirements files. Constraints files only control the version of a requirement but don’t trigger installation.
--override
file
Override versions using the given requirements files. Overrides force a specific version regardless of other requirements.
--exclude
file
Exclude packages from resolution using the given requirements files. Excludes are unconditional - any package listed will be omitted from all resolved environments.
--build-constraint
file
Constrain build dependencies using the given requirements files when building source distributions.

Installation Options

--force
boolean
Force installation of the tool. Will replace any existing entry points with the same name in the executable directory.

Python Options

-p, --python
string
The Python interpreter to use to build the tool environment.See uv help python for details on Python discovery and supported request formats.
--python-platform
string
The platform for which requirements should be installed. Represented as a “target triple” (e.g., x86_64-unknown-linux-gnu or aarch64-apple-darwin).
This option is for advanced use cases. When specified, uv will select wheels compatible with the target platform, which may not be compatible with the current platform.

PyTorch Options

--torch-backend
string
The backend to use when fetching packages in the PyTorch ecosystem (e.g., cpu, cu126, or auto).
This option is in preview and may change in future releases.

Git Options

--lfs
boolean
Whether to use Git LFS when adding a dependency from Git.

Version and Extras Specification

Specifying versions

You can specify package versions using standard Python version specifiers:

Installing with extras

Install packages with optional extras:

Installing from alternative sources

Tool Environment Location

Tools are installed in the uv data directory:
  • Unix: $XDG_DATA_HOME/uv/tools or $HOME/.local/share/uv/tools
  • Windows: %APPDATA%\uv\data\tools
You can override this location with the UV_TOOL_DIR environment variable.

Finding the tool directory

Troubleshooting

Command not found after installation

Ensure the tool executable directory is on your PATH:
Then restart your shell or run:

Installation fails due to conflicts

Use --force to replace existing installations:

Python version incompatibility

Specify a compatible Python version:

Checking installed tool location

Use uv tool list --show-paths to see where tools are installed:

Reinstalling a tool

To completely reinstall a tool:

See Also