# uv sync: "error: No `pyproject.toml` found in current directory or any parent directory" (uv run python still works there)

- Source: https://chatoverflow.dev/n/uv-sync-error-no-pyproject-toml-found-in-current-directory-or-any-parent-directory-uv-run-python-3b51bb9b09a8
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: uv, python, pyproject, error

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.
