{"record":{"id":"76a50e90715142a5","repo":"BerriAI/litellm","slug":"missing-boto3-botocore-to-call-bedrock-run-pip-i","errorCode":null,"errorMessage":"Missing boto3/botocore to call bedrock. Run 'pip install boto3'.","messagePattern":"Missing boto3/botocore to call bedrock\\. Run 'pip install boto3'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/batches/handler.py","lineNumber":110,"sourceCode":"        batch_id: str,\n        aws_region_name: str | None = None,\n        logging_obj: \"LiteLLMLoggingObj | None\" = None,\n        aws_access_key_id: str | None = None,\n        aws_secret_access_key: str | None = None,\n        aws_session_token: str | None = None,\n        aws_session_name: str | None = None,\n        aws_profile_name: str | None = None,\n        aws_role_name: str | None = None,\n        aws_web_identity_token: str | None = None,\n        aws_sts_endpoint: str | None = None,\n        aws_external_id: str | None = None,\n        **kwargs: object,  # kwargs-ok: litellm.cancel_batch forwards arbitrary user kwargs verbatim\n    ) -> \"LiteLLMBatch\":\n        try:\n            import boto3\n            from botocore.exceptions import ClientError\n        except ImportError as exc:\n            raise ImportError(\"Missing boto3/botocore to call bedrock. Run 'pip install boto3'.\") from exc\n\n        region: Final = aws_region_name or _extract_region_from_bedrock_arn(batch_id) or \"us-east-1\"\n\n        from litellm.llms.bedrock.batches.transformation import BedrockBatchesConfig\n\n        creds: Final = BedrockBatchesConfig().get_credentials(\n            aws_access_key_id=aws_access_key_id,\n            aws_secret_access_key=aws_secret_access_key,\n            aws_session_token=aws_session_token,\n            aws_region_name=region,\n            aws_session_name=aws_session_name,\n            aws_profile_name=aws_profile_name,\n            aws_role_name=aws_role_name,\n            aws_web_identity_token=aws_web_identity_token,\n            aws_sts_endpoint=aws_sts_endpoint,\n            aws_external_id=aws_external_id,\n        )\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/batches/handler.py#L92-L128","documentation":"Import guard while loading AWS credentials for Bedrock batch cancellation: importing botocore.credentials failed because boto3/botocore is not installed. Installing boto3 satisfies the import and lets the session/STS credential chain run.","triggerScenarios":"Thrown at litellm/llms/bedrock/batches/handler.py:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'pip install boto3 botocore' in the environment where litellm runs.","Verify boto3/botocore are installed in the same Python environment.","Check for virtualenv mismatches between install and runtime."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}