Skip to content

uv add and uv add -r fail with misleading 'No pyproject.toml...' error, while uv pip install works #11858

Description

@MohammedElHamraoui

Summary

mkdir uv-add-test-project
cd uv-add-test-project
uv venv .venv
source .venv/bin/activate
echo "fastapi[standard]" > requirements.txt # Minimal example
uv add -r requirements.txt # Fails with error
uv add fastapi[standard] # Fails with error
uv pip install -r requirements.txt # Works correctly
uv pip install fastapi[standard] # Works correctly

$ uv -v add -r requirements.txt
DEBUG uv 0.6.3
error: No pyproject.toml found in current directory or any parent directory

$ uv -v add fastapi[standard]
DEBUG uv 0.6.3
error: No pyproject.toml found in current directory or any parent directory

Platform

Linux Fedora 6.13.4-200.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Feb 22 16:09:10 UTC 2025 x86_64 GNU/Linux

Version

uv 0.6.3

Python version

CPython 3.13.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesMessaging when something goes wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions