BerriAI/litellm · error · ImportError

Missing boto3/botocore to call bedrock. Run 'pip install bot

Error message

Missing boto3/botocore to call bedrock. Run 'pip install boto3'.

What it means

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.

Source

Thrown at litellm/llms/bedrock/batches/handler.py:110

        batch_id: str,
        aws_region_name: str | None = None,
        logging_obj: "LiteLLMLoggingObj | None" = None,
        aws_access_key_id: str | None = None,
        aws_secret_access_key: str | None = None,
        aws_session_token: str | None = None,
        aws_session_name: str | None = None,
        aws_profile_name: str | None = None,
        aws_role_name: str | None = None,
        aws_web_identity_token: str | None = None,
        aws_sts_endpoint: str | None = None,
        aws_external_id: str | None = None,
        **kwargs: object,  # kwargs-ok: litellm.cancel_batch forwards arbitrary user kwargs verbatim
    ) -> "LiteLLMBatch":
        try:
            import boto3
            from botocore.exceptions import ClientError
        except ImportError as exc:
            raise ImportError("Missing boto3/botocore to call bedrock. Run 'pip install boto3'.") from exc

        region: Final = aws_region_name or _extract_region_from_bedrock_arn(batch_id) or "us-east-1"

        from litellm.llms.bedrock.batches.transformation import BedrockBatchesConfig

        creds: Final = BedrockBatchesConfig().get_credentials(
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            aws_region_name=region,
            aws_session_name=aws_session_name,
            aws_profile_name=aws_profile_name,
            aws_role_name=aws_role_name,
            aws_web_identity_token=aws_web_identity_token,
            aws_sts_endpoint=aws_sts_endpoint,
            aws_external_id=aws_external_id,
        )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Run 'pip install boto3 botocore' in the environment where litellm runs.
  2. Verify boto3/botocore are installed in the same Python environment.
  3. Check for virtualenv mismatches between install and runtime.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at litellm/llms/bedrock/batches/handler.py:110 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/76a50e90715142a5. Report an issue: GitHub.