{"record":{"id":"0e68495450045774","repo":"langchain-ai/deepagents","slug":"module-name-r-has-no-attribute-name-r","errorCode":null,"errorMessage":"module {__name__!r} has no attribute {name!r}","messagePattern":"module (.+?) has no attribute (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"libs/deepagents/deepagents/graph.py","lineNumber":137,"sourceCode":"\n\ndef __getattr__(name: str) -> str:\n    \"\"\"Provide deprecated compatibility access to legacy module attributes.\"\"\"\n    if name == \"BASE_AGENT_PROMPT\":\n        warn_deprecated(\n            since=\"0.7.0\",\n            removal=\"0.9.0\",\n            message=(\n                \"`BASE_AGENT_PROMPT` was deprecated in `deepagents==0.7.0` and \"\n                \"will be removed in `deepagents==0.9.0`. Deep Agents no longer \"\n                \"provides an \"\n                \"authored base prompt.\"\n            ),\n            package=\"deepagents\",\n        )\n        return _LEGACY_BASE_AGENT_PROMPT\n    msg = f\"module {__name__!r} has no attribute {name!r}\"\n    raise AttributeError(msg)\n\n\ndef _build_default_model() -> ChatAnthropic:\n    \"\"\"Construct the default model without emitting a deprecation warning.\n\n    Internal helper used by `create_deep_agent` so the parameter-level\n    `model=None` warning isn't paired with a separate function-level warning\n    from `get_default_model`. Direct user calls go through `get_default_model`,\n    which keeps its decorator and warns once per process.\n    \"\"\"\n    return ChatAnthropic(model_name=\"claude-sonnet-4-6\")\n\n\n@deprecated(\n    since=\"0.5.3\",\n    removal=\"1.0.0\",\n    message=(\n        \"Relying on the default model is deprecated and will be removed in \"","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/deepagents/deepagents/graph.py#L119-L155","documentation":"deepagents.graph implements module __getattr__ to lazily provide legacy attributes with deprecation warnings. When the requested attribute is not a known legacy export, the module raises a standard AttributeError saying the module has no such attribute.","triggerScenarios":"Importing or accessing an attribute on deepagents.graph that no longer exists — e.g. `from deepagents.graph import SomeRemovedSymbol` or `deepagents.graph.OldClass` after it was removed or renamed.","commonSituations":"Upgrading deepagents across a version where graph exports were renamed (e.g. to create_deep_agent); copying old tutorial code; stale IDE auto-imports.","solutions":["Use the current symbol, commonly create_deep_agent from the top-level package.","Update imports per the changelog/migration guide.","Run dir(deepagents.graph) to see available attributes.","Pin the older deepagents version temporarily if the legacy symbol is required."],"exampleFix":"// before\nfrom deepagents.graph import create_agent\n// after\nfrom deepagents import create_deep_agent","handlingStrategy":"try-catch","validationCode":"import deepagents.graph as g\nif not hasattr(g, \"create_agent\"):\n    from deepagents import create_deep_agent  # current API","typeGuard":"def graph_has(name: str) -> bool:\n    import deepagents.graph as g\n    return hasattr(g, name)","tryCatchPattern":"try:\n    from deepagents.graph import create_agent\nexcept AttributeError:\n    from deepagents import create_deep_agent as create_agent","preventionTips":["Import public entry points from the top-level deepagents package, not internal modules.","Check the changelog after every deepagents upgrade for renamed/removed exports.","Run mypy/pyright so stale imports fail at type-check time.","Treat module-level __getattr__ deprecation warnings as prompts to migrate immediately."],"tags":["python","attributeerror","deprecated-api"],"backgroundTag":"module-has-no-attribute","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}