Using Rust to make Python more manageable

It has long been best practice to use virtual python environments with locally installed libraries rather than system ones. However, setting up and managing those can be a hassle. Tools like pipx, pyenv and poetry went a long way to making life much easier but they have their own drawbacks.

Using Rust to make Python more manageable
Photo by Zdeněk Macháček / Unsplash


Introducing UV


"An extremely fast Python package and project manager, written in Rust."

UV is my new favorite Python tool, and it’s not even written in Python. This handy little CLI tool makes setting up a new Python project incredibly simple, thanks to sensible defaults and a streamlined workflow. With UV, you can avoid the typical headaches of environment management and package installation.

Why UV?

  1. Blazing Fast – Because UV is written in Rust, it is much faster than traditional Python-based tools.
  2. Minimal Dependencies – Unlike tools that require their own virtual environments or Python installations, UV operates independently.
  3. Unified Package Management – UV combines environment creation and package installation in a seamless way.
  4. Drop-in Replacement – UV aims to be a drop-in replacement for pip, pip-tools, virtualenv, venv, pipx, and even aspects of poetry.

Getting Started with UV

First, you’ll need to install UV. If you’re on a Unix-based system, you can install it using the following command:

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

On Windows, you can download and install it manually from the official UV documentation.

Once installed, you can create a new Python project and manage its dependencies effortlessly:

uv venv my_project
cd my_project
uv pip install requests

UV automatically creates a virtual environment and installs packages in it without needing separate activation commands.

A Better Workflow

UV simplifies Python project workflows in several ways:

  • Automatic virtual environment management – No need to manually set up or activate environments.
  • Lightning-fast dependency resolution – UV outperforms pip and poetry in many cases.
  • Cross-platform support – Works seamlessly across different operating systems.

Final Thoughts

Python developers are always on the lookout for tools that reduce friction and improve efficiency. UV stands out as a game-changer in package management and virtual environments. If you’re tired of slow dependency resolution, confusing package installations, or clunky environment setups, UV is definitely worth a try.

You can find more details and documentation at UV's official website. Happy coding!