Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install a Python package temporarily with uv without adding it to pyproject.toml?

Tags:

python

uv

I’m experimenting with the uv package manager for Python. Sometimes I want to try out a package briefly, but I don’t want to commit it to my project’s dependencies until I know I’ll use it.

In npm, one can run:

npm install package-name --no-save

which installs locally without modifying package.json.

I checked:

uv add --help

and the documentation, but I couldn’t find an equivalent --no-save option.

Is there an option or command in uv to install a package temporarily without adding it to pyproject.toml? If not, what’s the correct way to achieve this behavior?

like image 867
Rinato Fenice Avatar asked Sep 08 '25 15:09

Rinato Fenice


1 Answers

uv pip install dependency_name

would do exactly that - install the package keeping your pyproject and lockfile intact.

This is a low-level interface that mimics pip behavior as closely as possible. docs

like image 159
STerliakov Avatar answered Sep 10 '25 07:09

STerliakov