Setting Up a Python Development Environment on Mac with UV

Overview

This article introduces how to set up a Python development environment on Mac using UV.

What is UV?

UV is a package management tool announced in mid-2024.
It is written in Rust and is characterized by faster performance compared to other package managers.

Comparison with Other Package Managers

For official explanations, please refer to this site.

Usage

Installing UV

1
curl -LsSf https://astral.sh/uv/install.sh | sh

Add UV to your PATH:

1
2
source $HOME/.local/bin/env (sh, bash, zsh)
source $HOME/.local/bin/env.fish (fish)

Verify installation:

1
2
uv --version
uv 0.5.13 (c456bae5e 2024-12-27)

How to Use

Create a virtual environment:

1
uv venv

Activate the virtual environment:

1
source .venv/bin/activate

Install packages:

1
uv pip install <package name>

For more details on UV, refer to the official documentation.

Summary

This article explained how to set up a Python development environment on Mac.
As of January 2025, UV is both fast and easy to use, making it a valuable tool for setting up a Python development environment.