crewAIInc/crewAI · error · ProjectDefinitionError

[tool.crewai] definition must be a non-empty project-local p

Error message

[tool.crewai] definition must be a non-empty project-local path.

What it means

Error "[tool.crewai] definition must be a non-empty project-local path." thrown in crewAIInc/crewAI.

Source

Thrown at lib/crewai-core/src/crewai_core/project.py:91

    if pyproject_data is None:
        pyproject_data = read_toml(root / "pyproject.toml")

    crewai_config = get_crewai_project_config(pyproject_data)
    if crewai_config.get("type") != project_type:
        return None

    if "definition" not in crewai_config:
        return None
    raw_definition = crewai_config["definition"]
    if not isinstance(raw_definition, str):
        raise ProjectDefinitionError(
            "[tool.crewai] definition must be a string project-local path; "
            f"got {raw_definition!r}."
        )

    definition = raw_definition.strip()
    if not definition:
        raise ProjectDefinitionError(
            "[tool.crewai] definition must be a non-empty project-local path."
        )

    return resolve_project_definition_path(definition=definition, project_root=root)


def resolve_project_definition_path(definition: str, project_root: Path | str) -> Path:
    """Resolve a ``[tool.crewai].definition`` path inside ``project_root``."""
    root_path = Path(project_root)
    definition_path = Path(definition)
    windows_definition_path = PureWindowsPath(definition)

    if definition.startswith("~"):
        raise ProjectDefinitionError(
            "[tool.crewai] definition must be a project-local path; "
            f"got {definition!r}."
        )

View on GitHub (pinned to 754d7323be)

Solutions

  1. Provide a non-empty path for [tool.crewai].definition in pyproject.toml.
  2. Point the definition to an existing JSON crew definition file.

When it happens

Trigger: Thrown at lib/crewai-core/src/crewai_core/project.py:91 when the library encounters an invalid state.

Common situations: Occurs when [tool.crewai] definition in pyproject.toml is empty or whitespace. Set it to a non-empty project-local path.


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/d330a99994cc9679. Report an issue: GitHub.