-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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
- 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
-
Run:
pip install -r requirements.txt
-
Result: ResolutionImpossible errors
Related Work
- PR Fix Colab compatibility by relaxing requests version requirement #2460 partially addresses the requests version conflict by lowering the requirement from >=2.32.4 to >=2.32.0
Suggested Fix
google-adk should relax its dependency constraints:
- Critical:
starlette>=0.40.0,<1.0.0
(instead of >=0.46.2) - This would enable FastAPI compatibility requests>=2.13.0,<3.0.0
(instead of >=2.32.0 after PR Fix Colab compatibility by relaxing requests version requirement #2460)google-genai>=1.0.0,<2.0.0
(instead of >=1.21.1)
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.