# 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, [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.

## Related

- [uv: A Complete Guide](https://pydevtools.com/handbook/explanation/uv-complete-guide.md) covers what uv does, how fast it is, the core workflows, and recent releases.
- [How to fix common pytest errors with uv](https://pydevtools.com/handbook/how-to/how-to-fix-common-pytest-errors-with-uv.md) covers other uv error scenarios
- [How to fix Python version incompatibility errors in uv](https://pydevtools.com/handbook/how-to/how-to-fix-python-version-incompatibility-errors-in-uv.md) addresses `requires-python` conflicts
- [pyproject.toml reference](https://pydevtools.com/handbook/reference/pyproject.toml.md) documents the `[project]` table and its fields
- [What is PEP 723?](https://pydevtools.com/handbook/explanation/what-is-pep-723.md) explains inline script metadata as an alternative to project-level configuration
- [Create your first Python project](https://pydevtools.com/handbook/tutorial/create-your-first-python-project.md) walks through setting up a project with `uv init`
