{"record":{"id":"374481a10bc93950","repo":"crewAIInc/crewAI","slug":"crewai-is-not-in-the-dependencies","errorCode":null,"errorMessage":"crewai is not in the dependencies.","messagePattern":"crewai is not in the dependencies\\.","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"lib/crewai-core/src/crewai_core/project.py","lineNumber":176,"sourceCode":") -> Any | None:\n    \"\"\"Look up a dotted attribute path inside ``pyproject_path``.\n\n    The file must declare ``crewai`` in ``[project].dependencies`` for the\n    lookup to succeed (a guard against running these helpers outside a crewai\n    project directory). When ``require=True``, missing attributes raise\n    ``SystemExit`` after printing a friendly error.\n    \"\"\"\n    attribute = None\n\n    try:\n        with open(pyproject_path, \"r\") as f:\n            pyproject_content = parse_toml(f.read())\n\n        dependencies = (\n            _get_nested_value(pyproject_content, [\"project\", \"dependencies\"]) or []\n        )\n        if not any(True for dep in dependencies if \"crewai\" in dep):\n            raise Exception(\"crewai is not in the dependencies.\")\n\n        attribute = _get_nested_value(pyproject_content, keys)\n    except FileNotFoundError:\n        console.print(f\"Error: {pyproject_path} not found.\", style=\"bold red\")\n    except KeyError:\n        console.print(\n            f\"Error: {pyproject_path} is not a valid pyproject.toml file.\",\n            style=\"bold red\",\n        )\n    except Exception as e:\n        if sys.version_info >= (3, 11) and isinstance(e, tomllib.TOMLDecodeError):\n            console.print(\n                f\"Error: {pyproject_path} is not a valid TOML file.\", style=\"bold red\"\n            )\n        else:\n            console.print(\n                f\"Error reading the pyproject.toml file: {e}\", style=\"bold red\"\n            )","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-core/src/crewai_core/project.py#L158-L194","documentation":"Internal guard in _get_project_attribute: after parsing pyproject.toml, it verifies some entry in [project].dependencies contains the substring 'crewai'. If none does, it raises this generic Exception, which is then caught by the broad handler and printed as 'Error reading the pyproject.toml file: crewai is not in the dependencies.' It exists to prevent these helpers from running outside a real crewai project.","triggerScenarios":"Calling get_project_name/get_project_version/get_project_description (or anything using _get_project_attribute) in a directory whose pyproject.toml lacks 'crewai' in [project].dependencies — e.g. crewai only in [project.optional-dependencies], a dev/editable install not reflected in the TOML, or running from the framework's own repo.","commonSituations":"Running crewai CLI helpers from a non-crewai project or a fresh directory; dependencies declared under a different extra group; vendoring crewai without listing it; typo like 'crewAI-tools' only in optional-dependencies.","solutions":["Add crewai (or a crewai[tools]-style dependency containing 'crewai') to [project].dependencies in pyproject.toml.","Run the command from the crew project root, where the correct pyproject.toml lives.","If you use optional-dependencies only, also list the base package in [project].dependencies."],"exampleFix":"# before\n[project]\ndependencies = [\"litellm\", \"pydantic\"]\n\n# after\n[project]\ndependencies = [\"crewai\", \"litellm\", \"pydantic\"]","handlingStrategy":"validation","validationCode":"import tomllib\nfrom pathlib import Path\n\ndef has_crewai_dep(pyproject: Path) -> bool:\n    data = tomllib.loads(pyproject.read_text())\n    deps = data.get(\"project\", {}).get(\"dependencies\", [])\n    return any(\"crewai\" in d for d in deps)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run crewai helpers only from the crew project root containing a proper pyproject.toml.","Keep 'crewai' listed in [project].dependencies, not only optional-dependencies."],"tags":["configuration","pyproject-toml","dependencies"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}