BerriAI/litellm · error · ImportError

Missing boto3 to call AWS Polly. Run 'pip install boto3'.

Error message

Missing boto3 to call AWS Polly. Run 'pip install boto3'.

What it means

Error "Missing boto3 to call AWS Polly. Run 'pip install boto3'." thrown in BerriAI/litellm.

Solutions

  1. Install boto3: pip install boto3.

When it happens

Trigger: Thrown at litellm/llms/aws_polly/text_to_speech/transformation.py:267 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/04f55e4f4e45c060. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/aws_polly/text_to_speech/transformation.py:267

        return "<speak>" in input or "<speak " in input

    def _sign_polly_request(
        self,
        request_body: dict[str, Any],
        endpoint_url: str,
        litellm_params: dict,
    ) -> tuple[dict[str, str], str]:
        """
        Sign the AWS Polly request using SigV4.

        Returns:
            Tuple of (signed_headers, json_body_string)
        """
        try:
            from botocore.auth import SigV4Auth
            from botocore.awsrequest import AWSRequest
        except ImportError:
            raise ImportError("Missing boto3 to call AWS Polly. Run 'pip install boto3'.")

        # Get AWS region
        aws_region_name: Final = litellm_params.get("aws_region_name", self.DEFAULT_REGION)

        # Get AWS credentials
        credentials: Final = self.get_credentials(
            aws_access_key_id=litellm_params.get("aws_access_key_id"),
            aws_secret_access_key=litellm_params.get("aws_secret_access_key"),
            aws_session_token=litellm_params.get("aws_session_token"),
            aws_region_name=aws_region_name,
            aws_session_name=litellm_params.get("aws_session_name"),
            aws_profile_name=litellm_params.get("aws_profile_name"),
            aws_role_name=litellm_params.get("aws_role_name"),
            aws_web_identity_token=litellm_params.get("aws_web_identity_token"),
            aws_sts_endpoint=litellm_params.get("aws_sts_endpoint"),
            aws_external_id=litellm_params.get("aws_external_id"),
        )

View on GitHub (pinned to 77b7c6c40c)