Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add requirements.txt to uv environment

I am working with uv for the first time and have created a venv to manage my dependencies. Now, I'd like to install some dependencies from a requirements.txt file.

How can this be achieved with uv?

I already tried manually installing each requirement using uv pip install .... However, this gets tedious for a large list of requirements.

like image 831
BitsAndBytes Avatar asked Sep 01 '25 02:09

BitsAndBytes


1 Answers

You can install the dependencies to the virtual environment managed by uv using:

uv pip install -r requirements.txt

When working with a project (application or library) managed by uv, the following command might be used instead:

uv add -r requirements.txt

This will also add the requirements to the project's pyproject.toml.

like image 121
Hericks Avatar answered Sep 02 '25 16:09

Hericks