Skip to main content
uv is an extremely fast Python package and project manager. This guide will get you from installation to running your first project in minutes.

Install uv

Verify the installation:
If installed via the standalone installer, you can update uv with uv self update

Create your first project

1

Initialize a new project

Create a new Python project with uv init:
This creates a project structure with:
  • pyproject.toml - Project metadata and dependencies
  • .python-version - Python version pin
  • main.py - Sample Python file
  • README.md - Project documentation
2

Add a dependency

Navigate to your project and add a package:
uv automatically:
  • Creates a virtual environment (.venv)
  • Updates pyproject.toml with the dependency
  • Generates a lockfile (uv.lock)
  • Installs the package
3

Run a command

Execute commands in your project environment with uv run:
Run your Python script:

Working with dependencies

Lock and sync workflow

Generate or update the lockfile without installing:
Sync your environment with the lockfile:
uv run automatically syncs before running, so you don’t need to manually run uv sync in most cases

Add dependencies with version constraints

Remove dependencies

Manage Python versions

uv can install and manage Python versions for you.

Install Python

Use a specific Python version

Pin your project to a specific Python version:
Create a virtual environment with a specific Python version:

View installed Python versions

Run tools with uvx

Execute Python tools without installing them using uvx (an alias for uv tool run):
Run a specific version of a tool:

Install tools globally

For tools you use frequently, install them to make them available system-wide:

Next steps

Now that you have uv set up, explore more capabilities:

Working on Projects

Learn about project structure, managing dependencies, and building distributions

Running Scripts

Execute single-file scripts with inline dependency declarations

Python Installation

Deep dive into installing and managing Python versions

Using Tools

Master tool installation and management with uv and uvx
New to Python packaging? Check out our concepts guide to understand how uv manages projects, dependencies, and environments.