UV setup for computer vision using deep learning

DeepLearning
code
ComputerVision
python
linux
Author

Julien Combes

Published

April 13, 2025

UV is a drop-in replacement for pip and global python installation. I allows the management of python versions and packages.

# What is uv

uv is a python package manager that can replace pip and the installation of python itself on any machine. Its coded in rust and is make the management of python project very fast and robust.

All the example provided in this article are assuming you run on a linux system.

it is installable with a simple line in the terminal

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

This should make the uv command available through your shell.

you can check the python versions already available by running

uv python list

if the version of python you want is not already installed you can run the next command (change the 3.14 to the required python version)

uv python install 3.14

Creation on the environment

Unlike conda, uv is based on project directories and not on global environments. So each project will have its own uv configuration.

uv venv --python 3.12
uv init .
uv pip install -r requirements.txt

Example of requirement.txt allowing training of deep neural network

numpy
pandas
seaborn
matplotlib


torch
torchvision
opencv-python
lightning
albumentations