UV as_Package_Manager

This page explains how to install and use the uv project manager on Windows and macOS, and how to manage Python projects and notebooks using uv and marimo.

The guide assumes basic familiarity with the terminal or command line.

What is uv?[edit]

uv is a fast Python project and package manager developed by Astral. It handles:

  • Project initialization
  • Python version selection
  • Dependency management
  • Isolated environments
  • Tool execution

Installation[edit]

Windows[edit]

Install uvusing Powershell

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

After installation, restart your terminal and verify:

uv --version

macOS[edit]

On macOS, you have three installation options.

Option 1: PowerShell[edit]

If you use PowerShell on macOS:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Option 2: Shell script (wget)[edit]

wget -qO- https://astral.sh/uv/install.sh | sh

Option 3: Homebrew (recommended if available)[edit]

brew install uv

Verify installation:

uv --version

Creating a new uv project[edit]

Create a projects directory[edit]

In your terminal:

mkdir uvprojects
cd uvprojects

Initialize a new project[edit]

Create a new project with a specific Python version:

uv init myproject --python 3.13

This will:

  • Create a new project directory
  • Set up an isolated environment
  • Pin the Python version

Move into the project:

cd myproject

Managing Dependencies[edit]

Add Libraries[edit]

Add packages to your project:

uv add pandas
uv add numpy==2.26

Remove Libraries[edit]

Remove a dependency:

uv remove numpy

All dependencies are tracked automatically by **uv**.