{"record":{"id":"dd4d5b8ca71afbc3","repo":"PrefectHQ/fastmcp","slug":"module-name-r-has-no-attribute-name-r-dd4d5b","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":"fastmcp_slim/fastmcp/dependencies.py","lineNumber":55,"sourceCode":"    \"Progress\",\n    \"ProgressLike\",\n    \"Shared\",\n    \"TokenClaim\",\n]\n\n# Docket-specific dependencies moved to the fastmcp-tasks package. Point users\n# there instead of raising a bare AttributeError.\n_MOVED_TO_TASKS = {\"CurrentDocket\", \"CurrentWorker\"}\n\n\ndef __getattr__(name: str) -> Any:\n    if name in _MOVED_TO_TASKS:\n        raise ImportError(\n            f\"{name!r} moved to the fastmcp-tasks package. Install it with \"\n            f\"`pip install 'fastmcp[tasks]'` and import from \"\n            f\"`fastmcp_tasks.dependencies`.\"\n        )\n    raise AttributeError(f\"module {__name__!r} has no attribute {name!r}\")\n","sourceCodeStart":37,"sourceCodeEnd":56,"githubUrl":"https://github.com/PrefectHQ/fastmcp/blob/1f021142978e0861cd910c8df4e8074bc7cf3978/fastmcp_slim/fastmcp/dependencies.py#L37-L56","documentation":"This is the fallback AttributeError from fastmcp.dependencies.__getattr__: any attribute access on the module that is neither an exported name nor one of the names moved to fastmcp-tasks raises 'module fastmcp.dependencies has no attribute <name>'.","triggerScenarios":"`from fastmcp.dependencies import <Name>` or `fastmcp.dependencies.<Name>` where <Name> doesn't exist — misspelled dependency names (e.g. ApiKey vs APIKey), names that never existed, or names moved somewhere else entirely.","commonSituations":"Typos in dependency imports; guessing at names not in the module's exports; IDE auto-import picking the wrong module; older docs referencing renamed dependencies.","solutions":["Check the exact exported name via `dir(fastmcp.dependencies)` or the docs and fix the spelling","If the name is CurrentDocket/CurrentWorker, install 'fastmcp[tasks]' and import from fastmcp_tasks.dependencies (you'd get the ImportError variant instead)","Search the fastmcp source for the symbol to find its current module"],"exampleFix":"// before\nfrom fastmcp.dependencies import api_key\n\n// after\nfrom fastmcp.dependencies import ApiKey","handlingStrategy":"validation","validationCode":"import fastmcp.dependencies\nname = \"ApiKey\"\nif not hasattr(fastmcp.dependencies, name):\n    print(f\"{name} not in fastmcp.dependencies; check dir():\", [n for n in dir(fastmcp.dependencies) if not n.startswith('_')])","typeGuard":"def dependency_exists(name: str) -> bool:\n    import fastmcp.dependencies\n    return hasattr(fastmcp.dependencies, name)","tryCatchPattern":"try:\n    from fastmcp.dependencies import ApiKey\nexcept (ImportError, AttributeError) as e:\n    raise ImportError(f\"Check the exact dependency name in fastmcp docs: {e}\") from e","preventionTips":["Use IDE auto-complete against the real module instead of typing names from memory","Verify dependency names with dir(fastmcp.dependencies) or the API docs","Watch for renames in fastmcp release notes"],"tags":["python","attribute-error","import-error","fastmcp"],"backgroundTag":"module-has-no-attribute","analyzedSha":"1f021142978e0861cd910c8df4e8074bc7cf3978","analyzedAt":"2026-08-29T14:31:16.082Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}