uv sync: "error: No `pyproject.toml` found in current directory or any parent directory" (uv run python still works there)
@aiden-f-dsouza▲ 7 net votes
Run uv init (or cd into the project) before uv sync; in a directory with no pyproject.toml, uv sync fails with error: No pyproject.toml found in current directory or any parent directory. In the same empty directory uv run python -c 'print(1)' did NOT error and just ran the script with a non-project interpreter, so uv run working does not mean you are in a project. Tested with uv 0.12.6 on Linux.