uv Python Package Manager: Fix the “It Works on My Computer” Coding Problem

Posted on August 12, 2025 by Zach Strout

For as long as there has been more than one computer, someone has said, "I don’t know what the problem is. It works on my computer." As languages and programs became more complex, they increasingly relied on external code. Managing these dependencies is trivial for simple programs, but once packages like numpy, scipy, and pandas are involved, ensuring that code works reliably becomes daunting. That’s where uv comes in.

What is uv? uv is a python package manager far superior to pip because it automatically makes code compatible across all computers and is much faster installing packages than other common tools like pip, the standard way of installing python libraries. Before diving into how the Python package manager uv helps, here are some quick reasons to care about the “it works on my computer” problem. It is…

Better for science

Rather than relying on implicit descriptions of the packages and versions your Python program uses, you can provide a complete and reproducible environment for others. This can lead to better reproducibility, more citations, and more helpful contributions to the research community.

Better for teamwork

When more than one person is working on a codebase, managing Python versions and package versions can be a nightmare. A consistent setup across systems saves time and frustration.

Better for your personal productivity

Even when working solo, using something like uv helps you return to old projects without friction. Instead of figuring out what setup you used before, you can just run the code - even on a different computer or Python version.

Better for your future

Tools used to make Python more robust are becoming much more popular. For students wanting to get industry jobs in the future, it might be worth it to get familiar with these tools. uv itself was the most desired tool according to a stack overflow survey (Stack Overflow is a popular programmer Q&A website that has yearly surveys about what programmers like and what industry wants).

"It works on my computer"

Now that we have discussed some of the benefits of worrying about the "it works on my computer" problem and hinted at how uv might be able to solve this problem, lets dig into some specific problems that need to be solved.

There are two main problems when running a Python script on someone else's computer for the first time: Python version and Python library versions.

Python Version

Python versions release cycle

Python releases a new version every year. The current version to be released in October of this year will be Python 3.14. Each year adds features that can improve performance or make it easier to describe things with Python code. One of the nice things about Python is that it "comes with batteries". This means that there are lots of packages and libraries that come with Python so that you don't need to search, find, and install them. This, of course, means that you need to make sure that "the batteries" that come with the version of Python that you are using are compatible with the code. For example, if you use .toml files to save configuration files, the library that can read these files comes standard with Python 3.11, but before that, you will need to find your own libraries.

So it is important to make sure that you are using the right version of Python.

Python Library Versions

Much like how Python versions have changes that are not compatible with previous versions, Python library versions also can make significant changes that break functionality. For example, a library called Numpy that is used for doing advanced math and operations in python was recently updated to 2.0. While the changes were needed and important, it broke a lot of programs. So if you were to install the new version of Numpy, old code would not run without error. Instead of chasing down versions and fixing code when updating to another version, a better way is to just specify and lock the code to use a certain version of a library.

How Python Currently Solves These Versioning Problems

These problems have been known for a long time, so there are solutions to them, but the solutions are really complicated. For the python version problem, the standard solution is to use virtual environments. Virtual Environments are copies of Python that are kept within the project so that when you want to run Python code, you can run using these isolated copies of Python. This actually works pretty well, but it can be a hassle to make sure that you "activate" the virtual environment so that running python yourscript.py actually runs your python script rather than the default python installation. Also, there are several different tools that can be used to work and manage these virtual environments, so it can be confusing to know what to use.  

For the python library problem, this also has a solution, but it also has problems. As many know, the default way of installing python libraries is to use the pip python package manager. You can use pip install numpy, and it will install Numpy. If you want to export what version are installed with pip, you can use the command pip freeze > requirements.txt to save the packages installed to a file called requirements.txt in a format like this:

numpy==2.3.1
psutil==7.0.0
requests==2.32.4

You can then install these versions using pip install -r requirements.txt.

This is useful, but it does not track the dependencies well and there still might be problems.

uv is Better than pip

uv is a single program that replaces many of the other tools used to manage a python environment. Need to install a python package? You can use uv add numpy, and it will find and install numpy. Want to run a script with the virtual environment without forgetting to activate it? You can use uv run python yourscript.py. Want to synchronize the current virtual environment with the needed packages? You can run uv sync, and all of the needed libraries are installed.

One of the major differences for uv is that it creates a configuration file that is used to keep track of the dependencies. When you first run `uv init` which converts a folder into a python project, it will create a pyproject.toml file which is the standard way of declaring what the project needs. A sample file could be something like below:

[project]
name = "test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = []

When you add a library like numpy to the project, it will add the dependencies into the the file like below:

dependencies = [
    "numpy>=2.3.2",
]

It will also create a uv.lock file. This file contains all of the specific version information and where to find the packages installed for any OS version. When you run uv sync, it will look in the uv.lock file and find the exact versions and installs so that you can guarantee that the save exact version of the packages is installed for any computer.

The nice thing is that it can also manage what version of python is installed. If you get a python project that needs Python 3.11.11, uv will automatically download and install it for you so that you don't need to track it down online.

One extra benefit of uv is that it is really fast. uv is written in a really fast programming language called Rust. Instead of waiting roughly 30 seconds for scipy to install, you can install 10 times faster with uv.

UV is really fast

Getting started with uv

To get started with uv, you can simply install it with pip: pip install uv

You can see some great examples on how to use it at the github repo for the project.

For more info about virtual environments, you can check out this page.

Next
Next

How Does an IMU Work?