# How to fix "No `project` Table Found" error in uv

[uv](https://pydevtools.com/handbook/reference/uv.md) project commands (`uv run`, `uv sync`, `uv add`) expect a `[project]` table in [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md). Without one, uv reports:

```
error: No `project` table found in: `/path/to/pyproject.toml`
```

This happens in two common situations: a repository uses `pyproject.toml` only for tool configuration ([Ruff](https://pydevtools.com/handbook/reference/ruff.md), [Black](https://pydevtools.com/handbook/reference/black.md), [mypy](https://pydevtools.com/handbook/reference/mypy.md)) without declaring a project, or a `pyproject.toml` was created manually and the `[project]` table was omitted.

## Add a `[project]` table

If the directory is a Python project, add the required table to `pyproject.toml`:

```toml
[project]
name = "your-project-name"
version = "0.1.0"
requires-python = ">=3.10"
```

Or let uv generate it:

```console
$ uv init
```

`uv init` creates a `pyproject.toml` with `[project]` metadata pre-filled. If the file already exists, uv merges the `[project]` table into it while preserving existing tool configuration sections.

## Skip project discovery with `--no-project`

If the directory is not a Python project (for example, a repo that only stores [Ruff](https://pydevtools.com/handbook/reference/ruff.md) or [pytest](https://pydevtools.com/handbook/reference/pytest.md) configuration), pass `--no-project` to bypass the check:

```console
$ uv run --no-project python script.py
```

This tells uv to ignore the `pyproject.toml` and run without a project context, the same behavior as if no `pyproject.toml` existed.

## Use `--script` for standalone scripts

If the script uses [inline metadata](https://pydevtools.com/handbook/explanation/what-is-pep-723.md) instead of a project-level `pyproject.toml`, run it with the `--script` flag:

```console
$ uv run --script script.py
```

This reads dependencies from the script's own `# /// script` block rather than looking for a `[project]` table.
