{"record":{"id":"86c692ce8017f15b","repo":"BerriAI/litellm","slug":"missing-boto3-to-call-bedrock-run-pip-install-bo-86c692","errorCode":null,"errorMessage":"Missing boto3 to call bedrock. Run 'pip install boto3'.","messagePattern":"Missing boto3 to call bedrock\\. Run 'pip install boto3'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/common_utils.py","lineNumber":1475,"sourceCode":"    ) -> tuple:\n        \"\"\"\n        Sign AWS request using Signature Version 4.\n\n        Args:\n            service_name: AWS service name (\"bedrock\" or \"s3\")\n            data: Request data (string or dict)\n            endpoint_url: Full endpoint URL\n            optional_params: Optional parameters containing AWS credentials\n            method: HTTP method (default: POST)\n\n        Returns:\n            Tuple of (signed_headers, signed_data)\n        \"\"\"\n        try:\n            from botocore.auth import SigV4Auth\n            from botocore.awsrequest import AWSRequest\n        except ImportError:\n            raise ImportError(\"Missing boto3 to call bedrock. Run 'pip install boto3'.\")\n\n        # Get AWS credentials using existing methods\n        aws_region_name: Final = self._base_aws._get_aws_region_name(optional_params=optional_params, model=\"\")\n        credentials: Final = self._base_aws.get_credentials(\n            aws_access_key_id=optional_params.get(\"aws_access_key_id\"),\n            aws_secret_access_key=optional_params.get(\"aws_secret_access_key\"),\n            aws_session_token=optional_params.get(\"aws_session_token\"),\n            aws_region_name=aws_region_name,\n            aws_session_name=optional_params.get(\"aws_session_name\"),\n            aws_profile_name=optional_params.get(\"aws_profile_name\"),\n            aws_role_name=optional_params.get(\"aws_role_name\"),\n            aws_web_identity_token=optional_params.get(\"aws_web_identity_token\"),\n            aws_sts_endpoint=optional_params.get(\"aws_sts_endpoint\"),\n        )\n\n        # Prepare the request data\n        method_upper: Final = method.upper()\n        if method_upper == \"GET\":","sourceCodeStart":1457,"sourceCodeEnd":1493,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/common_utils.py#L1457-L1493","documentation":"LiteLLM's Bedrock request-signing path needs botocore's SigV4Auth to sign requests; when the import fails it raises this ImportError telling you boto3/botocore is not installed. It occurs while preparing a signed AWS request, before any network call is made.","triggerScenarios":"Running LiteLLM with the bedrock provider in an environment where 'pip install boto3[bedrock]' was never run, or where botocore was uninstalled/upgraded away; also slim Docker images that omit optional AWS extras.","commonSituations":"Installing litellm without the [extra_proxy] or AWS extras, CI images trimmed for size, dependency resolvers downgrading/removing botocore, or virtualenv mismatch where the app runs in a different interpreter than the one where boto3 was installed.","solutions":["pip install boto3 (or pip install 'boto3[bedrock]') in the active interpreter","Add boto3 to your requirements.txt/pyproject dependencies alongside litellm","Verify with: python -c \"import botocore.auth\" in the same venv the app runs in"],"exampleFix":"# before: ImportError at request time\n# after\npip install \"boto3[bedrock]\"\npython -c \"from botocore.auth import SigV4Auth; print('ok')\"","handlingStrategy":"type-guard","validationCode":"def boto3_available() -> bool:\n    try:\n        import botocore.auth, botocore.awsrequest  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nassert boto3_available(), \"pip install boto3 before using bedrock provider\"","typeGuard":null,"tryCatchPattern":"try:\n    resp = await client.sign_and_call(...)\nexcept ImportError as e:\n    if 'boto3' in str(e):\n        sys.exit(\"AWS provider unavailable: install boto3 or switch to a non-Bedrock model\")","preventionTips":["Add boto3 (or litellm[extra_proxy]) to pinned dependencies","Run a startup dependency check in entrypoints that use bedrock","Bake boto3 into deployment images instead of relying on runtime installs"],"tags":["bedrock","boto3","dependencies","aws"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}