Skip to content

Dependency Conflicts: Unable to use google-adk v1.12.0 with FastAPI and other common packages #2657

@qfennessy

Description

@qfennessy

Dependency Conflicts: Unable to use google-adk v1.12.0 with FastAPI and other common packages

Description

google-adk v1.12.0 has overly restrictive dependency requirements that conflict with commonly used packages, making it impossible to build projects that use both google-adk and standard web frameworks like FastAPI.

Environment

  • Python: 3.11
  • google-adk: 1.12.0
  • Build environment: Google Cloud Build (Docker/Kaniko)

Conflicting Dependencies

1. Starlette Version Conflict (Primary Blocker)

ERROR: Cannot install because these package versions have conflicting dependencies:
- fastapi 0.115.5 requires: starlette<0.42.0 and >=0.40.0
- google-adk 1.12.0 requires: starlette<1.0.0 and >=0.46.2

Incompatible ranges: No version of starlette satisfies both constraints. This is the main blocker preventing FastAPI compatibility.

2. Requests Version Conflict

ERROR: Cannot install because these package versions have conflicting dependencies:
- requests 2.31.0 (commonly used version)
- spacy 3.7.0 requires: requests<3.0.0 and >=2.13.0
- google-adk 1.12.0 requires: requests<3.0.0 and >=2.32.4

Issue: Forces upgrade to requests >=2.32.4, breaking compatibility with pinned versions.
Note: PR #2460 partially addresses this by lowering the requirement to >=2.32.0, but this still excludes commonly used versions like 2.31.0.

3. Google-genai Version Conflict

ERROR: Cannot install because these package versions have conflicting dependencies:
- google-cloud-aiplatform 1.95.1 requires: google-genai<2.0.0 and >=1.0.0
- google-adk 1.12.0 requires: google-genai<2.0.0 and >=1.21.1

Issue: Overly specific lower bound (>=1.21.1) conflicts with other Google packages.

Impact

  • Cannot use google-adk with FastAPI (one of the most popular Python web frameworks)
  • Forced to use specific versions of common packages (requests), breaking existing codebases
  • Cannot use google-adk alongside other Google Cloud AI packages without version conflicts

Steps to Reproduce

  1. Create a requirements.txt with:
fastapi==0.115.5
google-adk>=1.12.0
google-cloud-aiplatform>=1.95.1
spacy==3.7.0
requests==2.31.0
  1. Run: pip install -r requirements.txt

  2. Result: ResolutionImpossible errors

Related Work

Suggested Fix

google-adk should relax its dependency constraints:

This would maintain compatibility while allowing co-existence with common packages.

Current Workaround

None available - must choose between using google-adk or using FastAPI/standard versions of common packages.

Additional Context

This issue was discovered while trying to deploy a FastAPI application that uses google-adk for AI agent functionality to Google Cloud Run. The build consistently fails during the pip install phase due to these dependency conflicts.

Metadata

Metadata

Assignees

Labels

bot triaged[Bot] This issue is triaged by ADK botcore[Component] This issue is related to the core interface and implementation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions