Just like Rusts cargo, uv simplifies the managenment of Python projects. You can create virtual environments, run and build packages fast and easy.
$ curl -LsSf https://astral.sh/uv/install.sh | sh
In uv you create the whole virtual environment and initialise git with a single command.
$ uv init
This creates the following direcory structure
.
├── .git
├── .gitignore
├── .python-version
├── .venv
├── main.py
├── pyproject.toml
├── README.md
└── uv.lock
To run main.py just type
$ uv run main.py
To achieve the same with pip and python you have to execute the following command:
Create a virtual environment
$ python3 -m venv .venv
Activate the virtual environment
$ source .venv/bin/activate
Initialise git version control
$ git init
Add a .gitignore
$ touch .gitignore
Add a README.md
$ touch README.md
Create a Python hello world file
$ touch main.py
Run your python file
python main.py
On uv init the following default toml is created
[project]
name = "foo"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.14"
dependencies = []
$ uv sync
This creates .venv if not created yet and a uv.lock which feezes the exact versions of dependencies and tools used in this project similar to pips freeze and makes the environment reprocucible.
$ pip freeze > requirements.txt
To add a dependency to a local project
$ uv add numpy
Using native python you would have to execute
$ pip install numpy
General and project independent tools should be installed with uvx
$ uvx ruff
Which is short for uv tool run and installs the dependencies globally.
$ uv python pin 3.14