Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Python

Overview: Python interpreter + UV

To work effectively with Python, you need two components:

  1. A Python interpreter: This is the core Python installation that runs your code.

  2. UV: A modern package and project manager that handles installing libraries, managing dependencies, and creating isolated environments for your projects.

Why UV?

UV solves several critical problems in Python development:

While there are other package managers (we’ll also install Pixi for conda packages), UV is currently the best choice for managing Python packages from PyPI, which includes most of the scientific Python ecosystem.

Why not only UV then?

UV can actually install and manage Python interpreters itself without needing a separate installation. However, relying exclusively on UV-managed Python has some limitations in certain use cases, particularly around system integration and compatibility with specific tools. Installing a standalone Python interpreter alongside UV provides greater flexibility and ensures compatibility across different workflows.

Install a Python interpreter

Windows
macOS
Debian-Ubuntu-Mint

On Windows, use the Python install manager to install Python. You have two options:

  1. Microsoft Store (recommended): Install “Python” from the Microsoft Store

  2. WinGet: Run winget install 9NQ7512CXL7T in PowerShell or Command Prompt

Once installed, you can install Python 3.13 (or any other version) using:

py install 3.13

The install manager uses the py command and will automatically update itself. You can see all available Python versions with py list --online.

UV: Modern Python package and project manager

UV is a fast, modern Python package and project manager developed in Rust by Astral. It has quickly become the recommended tool for managing Python packages and projects due to its speed and reliability.

What UV does for you

Installation

To install UV, open a terminal and run

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

Once the installation is complete, open a new terminal and verify that the uv command is available:

uv --version

You should see the UV version number displayed.