uv
An extremely fast Python package and project manager, written in Rust.
Installation
Section titled “Installation”curl -LsSf https://astral.sh/uv/install.sh | shFeatures
Section titled “Features”Python versions
Section titled “Python versions”Installing and managing Python itself.
# install Python versionsuv python install
# view available Python versionsuv python list
# find an installed Python versionuv python find
# pin the current project to use a specific Python versionuv python pin
# uninstall a Python versionuv python uninstallProjects
Section titled “Projects”Creating and working on Python projects, i.e., with a pyproject.toml.
# create a new projectuv init
# add a dependency to the project.uv add
# remove a dependency from the projectuv remove
# sync the project's dependencies with the environmentuv sync
# create a lockfile for the project's dependenciesuv lock
# run a command in the project environmentuv run
# view the dependency tree for the projectuv tree
# build the project into distribution archivesuv build
# publish the project to a package indexuv publishScripts
Section titled “Scripts”Executing standalone Python scripts, e.g., example.py.
# create a new scriptuv init --script example.py --python 3.12
# run a scriptuv run
# add a dependency to a scriptuv add --script
# remove a dependency from a scriptuv remove --script
# run a Python script with a specific dependency without installing it globallyuv run --with rich example.pyRunning and installing tools published to Python package indexes, e.g., ruff or black.
# run a tool in a temporary environmentuvx ruff --version
# install or uninstall a tool user-wideuv tool install ruffuv tool uninstall ruff
# manage the installed tool cataloguv tool listuv tool update-shellThe pip interface
Section titled “The pip interface”Manually managing environments and packages—intended for legacy workflows or when the higher-level commands do not provide enough control.
Creating virtual environments
Section titled “Creating virtual environments”# create a virtual environment (replacement for venv / virtualenv)uv venvManaging packages in an environment
Section titled “Managing packages in an environment”# install or remove packages in the active environmentuv pip install requestsuv pip uninstall requests
# inspect package metadata and compatibilityuv pip show requestsuv pip check
# review dependency stateuv pip listuv pip freezeuv pip treeUtilities
Section titled “Utilities”Managing and inspecting uv’s state, such as the cache, storage directories, or performing a self-update.
# maintain cachesuv cache cleanuv cache prune
# locate storage directoriesuv cache diruv tool diruv python dir
# update uv itselfuv self update