{"record":{"id":"863201fa13398a80","repo":"Graphify-Labs/graphify","slug":"the-boto3-package-is-required-for-this-backend-b","errorCode":null,"errorMessage":"the 'boto3' package is required for this backend but is not installed. Install it with:  uv tool install \"graphifyy[bedrock]\" --force  (uv tool), or  pip install boto3  (pip/venv install).","messagePattern":"the 'boto3' package is required for this backend but is not installed\\. Install it with:  uv tool install \"graphifyy\\[bedrock\\]\" --force  \\(uv tool\\), or  pip install boto3  \\(pip/venv install\\)\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"graphify/llm.py","lineNumber":2660,"sourceCode":"            raise RuntimeError(f\"claude -p reported an error: {cli_error[:500]}\")\n        envelope = _claude_cli_envelope(proc.stdout)\n        cli_usage = envelope.get(\"usage\") or {}\n        if cli_usage:\n            _rec(\n                (cli_usage.get(\"input_tokens\", 0) or 0)\n                + (cli_usage.get(\"cache_read_input_tokens\", 0) or 0)\n                + (cli_usage.get(\"cache_creation_input_tokens\", 0) or 0),\n                cli_usage.get(\"output_tokens\", 0),\n            )\n        return envelope.get(\"result\", \"\")\n\n\n    if backend == \"bedrock\":\n        try:\n            import boto3\n            import botocore.config\n        except ImportError as exc:\n            raise ImportError(_backend_pkg_hint(\"boto3\", \"bedrock\")) from exc\n        region = os.environ.get(\"AWS_REGION\") or os.environ.get(\"AWS_DEFAULT_REGION\") or \"us-east-1\"\n        profile = os.environ.get(\"AWS_PROFILE\")\n        session = boto3.Session(profile_name=profile, region_name=region)\n        client = session.client(\n            \"bedrock-runtime\",\n            config=botocore.config.Config(\n                read_timeout=_resolve_api_timeout(),\n                connect_timeout=10,\n                retries={\"max_attempts\": _resolve_max_retries() + 1, \"mode\": \"adaptive\"},\n            ),\n        )\n        resp = client.converse(\n            modelId=mdl,\n            messages=[{\"role\": \"user\", \"content\": [{\"text\": prompt}]}],\n            inferenceConfig=_bedrock_inference_config(max_tokens, mdl),\n        )\n        bu = resp.get(\"usage\") or {}\n        if bu:","sourceCodeStart":2642,"sourceCodeEnd":2678,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/llm.py#L2642-L2678","documentation":"ImportError raised when backend='bedrock' is selected but boto3 (and botocore.config) are not installed. Like the other backends, bedrock is an optional extra; the message points at the graphifyy[bedrock] extra or a plain pip install, and chains the original ModuleNotFoundError.","triggerScenarios":"An LLM call dispatches to the bedrock branch at llm.py:2662-2666 and `import boto3` or `import botocore.config` fails. Configuration names bedrock (env/config/providers.json), e.g. to use Claude via AWS Bedrock with corporate credentials.","commonSituations":"Teams standardize on AWS and set backend=bedrock without adding the extra; uv tool installs of graphifyy that only carried [anthropic]; environments where boto3 was uninstalled as part of a botocore/boto3 version conflict with other tooling.","solutions":["Install the extra: `uv tool install \"graphifyy[bedrock]\" --force` or `pip install boto3` in the active environment.","Confirm AWS credentials and region are usable: `aws sts get-caller-identity` - bedrock also needs AWS_REGION/AWS_DEFAULT_REGION (default us-east-1) and optionally AWS_PROFILE.","Verify in the same interpreter: `python -c \"import boto3, botocore.config\"`."],"exampleFix":"# before\nbackend = \"bedrock\"   # ImportError: boto3 required\n\n# after\n# pip install boto3  (or uv tool install \"graphifyy[bedrock]\" --force)\nbackend = \"bedrock\"\n# ensure region + credentials:\n#   export AWS_REGION=us-east-1 && aws sts get-caller-identity","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec(\"boto3\") is None or importlib.util.find_spec(\"botocore\") is None:\n    raise SystemExit(\"backend 'bedrock' needs boto3: pip install boto3\")","typeGuard":null,"tryCatchPattern":"try:\n    result = call_llm(prompt, backend=\"bedrock\")\nexcept ImportError as exc:\n    if \"boto3\" in str(exc):\n        raise SystemExit(f\"Missing optional dep: {exc}\") from exc\n    raise","preventionTips":["Add the extras matching every backend you might switch to at install time.","In AWS contexts verify model access has been granted in the Bedrock console (missing model access also produces confusing downstream errors).","Keep AWS_PROFILE/AWS_REGION explicit in CI to avoid environment-dependent behavior."],"tags":["python","dependencies","aws","bedrock","import-error","llm"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}