{"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/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/common_utils.py#L1457-L1493","documentation":"Raised by BedrockFileTransformation.sign_aws_request when the botocore modules needed for AWS SigV4 signing (botocore.auth.SigV4Auth, botocore.awsrequest.AWSRequest) cannot be imported. LiteLLM does not vendor AWS signing; it depends on boto3/botocore being installed in the same environment. Any Bedrock feature that signs requests itself (S3 file uploads for file-based transformations, batch jobs) hits this guard.","triggerScenarios":"Invoking bedrock file-based transformation or batch APIs (which call sign_aws_request with service 'bedrock' or 's3') in an environment where botocore is not installed, is installed for a different Python interpreter/virtualenv, or is a broken partial install.","commonSituations":"Installing litellm with the minimal wheel (boto3 is an optional extra, not a hard dependency) then calling bedrock file/batch endpoints; pip installing as root but running the app under a different user/venv; Docker images that strip boto3; dependency resolvers downgrading or removing botocore.","solutions":["Install the AWS extra: pip install 'litellm[bedrock]' (or plain 'pip install boto3') in the SAME virtualenv/interpreter that runs litellm","Verify with: python -c \"import botocore.auth, botocore.awsrequest\" using the exact interpreter your app runs on","In containers, add boto3 to the image requirements and rebuild rather than relying on runtime installs","If your package manager (poetry/uv/pipenv) pruned it, pin boto3 explicitly in your dependency manifest"],"exampleFix":"# before: litellm installed bare\npip install litellm\n\n# after\npip install 'litellm[bedrock]'   # pulls in boto3/botocore","handlingStrategy":"validation","validationCode":"def assert_boto3_available() -> None:\n    try:\n        import botocore.auth  # noqa: F401\n        import botocore.awsrequest  # noqa: F401\n    except ImportError as e:\n        raise RuntimeError(\n            'boto3 missing for bedrock signing; run: pip install \"litellm[bedrock]\"'\n        ) from e\n\nassert_boto3_available()  # call once at app startup","typeGuard":null,"tryCatchPattern":"try:\n    signed = transformer.sign_aws_request('s3', payload, url, params)\nexcept ImportError as e:\n    if 'pip install boto3' in str(e):\n        raise DependencyError('install litellm[bedrock] extra') from e\n    raise","preventionTips":["Declare boto3 as an explicit dependency in requirements/pyproject, not transitively","Add a startup health check that imports botocore in the runtime interpreter","Pin the same dependency set in Docker/CI as production"],"tags":["bedrock","boto3","dependency","importerror","aws"],"backgroundTag":"missing-python-package","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}