BerriAI/litellm · error · ImportError
Google Cloud SDK not found. Install it with: pip install…
Error message
Google Cloud SDK not found. Install it with: pip install 'litellm[google]' or pip install google-cloud-aiplatform
What it means
ImportError sentinel from the Vertex AI AWS workload-identity-federation path: google.auth is not installed (or lacks the aws module), so GCP credentials cannot be created from AWS credentials. The message names the pip extra that supplies the SDK.
Solutions
- Install the Google Cloud dependencies: pip install 'litellm[google]' or pip install google-cloud-aiplatform.
- Verify the installation succeeded in the same Python environment running litellm.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/llms/vertex_ai/vertex_ai_aws_wif.py:69 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/7e3031915aca6e7c.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/vertex_ai/vertex_ai_aws_wif.py:69
@staticmethod
def credentials_from_explicit_aws(json_obj, aws_params, scopes):
"""
Create GCP credentials using explicit AWS credentials for WIF.
Uses BaseAWSLLM to obtain AWS credentials (via STS AssumeRole, profile,
static keys, etc.), then wraps them in a custom AwsSecurityCredentialsSupplier
so that google-auth bypasses the EC2 metadata service.
Args:
json_obj: The WIF credential JSON dict (contains audience, token_url, etc.)
aws_params: Dict of aws_* params extracted from json_obj
scopes: OAuth scopes for the GCP credentials
"""
try:
from google.auth import aws
except ImportError:
raise ImportError(GOOGLE_IMPORT_ERROR_MESSAGE)
from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM
from litellm.llms.vertex_ai.aws_credentials_supplier import (
AwsCredentialsSupplier,
)
# Validate region first — required for the GCP token exchange.
# Check before get_credentials() to avoid unnecessary AWS API calls
# (e.g. STS AssumeRole) on misconfiguration.
aws_region: Final = aws_params.get("aws_region_name")
if not aws_region:
raise ValueError(
"aws_region_name is required in the WIF credential JSON "
"when using explicit AWS authentication. Add "
'"aws_region_name": "<your-region>" to your credential file.'
)
# Build a credentials provider that re-resolves AWS creds on each call.View on GitHub (pinned to 77b7c6c40c)