adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Can you not break the framework when upgrading version

Open weimeilin79 opened this issue 1 year ago • 12 comments

Describe the bug When attempting to run the adk command (e.g., adk --version or any workshop command), a ModuleNotFoundError: No module named 'deprecated' occurs. This issue prevents the adk CLI tools from running and has broken a previously working development workflow.

To Reproduce Steps to reproduce the behavior: In Python 3.12 Install google-adk==0.4.0

adk --version

Additional context This issue emerged while working with an existing installation of google-adk version 0.4.0. The adk commands and associated workshop content were functioning correctly until this ModuleNotFoundError started appearing. The traceback clearly indicates that the google.adk package (specifically google/adk/tools/base_tool.py) is trying to import deprecated, but this module is not found.

It is critical for developer workflows that even within the same minor version (e.g., 0.4.x), dependencies remain stable or are properly declared to prevent unexpected breakage. Maintaining backward compatibility and avoiding new, undeclared dependency requirements on existing versions is highly appreciated to ensure stability for projects.

File "/home/meerabaelish_560773/instavibe-bootstrap/env/bin/adk", line 5, in from google.adk.cli import main File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/init.py", line 16, in from .agents.llm_agent import Agent File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/agents/init.py", line 15, in from .base_agent import BaseAgent File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/agents/base_agent.py", line 32, in from ..events.event import Event File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/events/init.py", line 15, in from .event import Event File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/events/event.py", line 25, in from ..models.llm_response import LlmResponse File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/models/init.py", line 19, in from .llm_request import LlmRequest File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/models/llm_request.py", line 24, in from ..tools.base_tool import BaseTool File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/tools/init.py", line 15, in from .base_tool import BaseTool File "/home/meerabaelish_560773/instavibe-bootstrap/env/lib/python3.12/site-packages/google/adk/tools/base_tool.py", line 23, in from deprecated import deprecated ModuleNotFoundError: No module named 'deprecated'

I also tested other version, they are all broken

weimeilin79 avatar Jun 04 '25 20:06 weimeilin79

I tested 0.4, 1.0 and 1.1 with new virtual env, all had the same issue!

weimeilin79 avatar Jun 04 '25 20:06 weimeilin79

I have the same issue. Tried with different versions.

me-her avatar Jun 04 '25 20:06 me-her

Same issue

SAMFVH avatar Jun 04 '25 20:06 SAMFVH

Related to #1125

jackwotherspoon avatar Jun 04 '25 21:06 jackwotherspoon

A workaround (not a nice one) for the time being is to explicitly install the deprecated package via pip install deprecated as pointed out in #1125

jackwotherspoon avatar Jun 04 '25 21:06 jackwotherspoon

https://github.com/google/adk-python/pull/1160 but it will need a release. I would strongly recommend locking your dependencies with something like UV, poetry, or even just pip-compile so that you can always get back to a working state.

aabmass avatar Jun 04 '25 21:06 aabmass

I thought I was crazy.

marianocodes avatar Jun 04 '25 22:06 marianocodes

Thanks for the fix! @aabmass , we're getting a patched version out fix this.


For people who are interested. Refer to https://github.com/google/adk-python/issues/1125 for the root cause.

Jacksunwei avatar Jun 04 '25 23:06 Jacksunwei

We released 1.2.1 with patch of https://github.com/google/adk-python/pull/1160. Thanks!

Jacksunwei avatar Jun 04 '25 23:06 Jacksunwei

I don't thin you should close this issue, because the rest of the versions are still broken. And we are running a workshop that are test with 0.4.0. This bug still breaks all the docker build. @Jacksunwei ^^^

weimeilin79 avatar Jun 05 '25 01:06 weimeilin79

To summarize, the root cause is the latest opentelemetry-api removes a deps, from technical perspective, we cannot fix the released version in pypi.

The workaround would be either of

  • upgrade to 1.2.1
  • or pip install deprecated in the local venv
  • or add deprecated to requirements.txt file for cloud run or other docker-based deployment.

Jacksunwei avatar Jun 05 '25 01:06 Jacksunwei

I wanted to add my own experience to confirm this undeclared‐dependency issue with google-adk v0.2.0. 

I was working on macOS with Python 3.13 in a fresh venv and installed google-adk==0.2.0.  When I attempted to start my FastAPI server (via uvicorn api:app --host 0.0.0.0 --port 8080), it immediately failed with:

ModuleNotFoundError: No module named 'deprecated'

This traceback pointed directly to google/adk/tools/base_tool.py trying to import deprecated. 

Because Deprecated was never listed in the package requirements, pip did not install it, causing all ADK CLI and Python imports to break. 

As a result, any automated workflows (e.g., CI pipelines or container builds) that rely on ADK now fail unless pip install Deprecated is explicitly run.

Easy Fix: 

In an environment, manually install Deprecated (v1.2.18) to unblock development, but this clearly isn’t sustainable. 

Shai-Shillo avatar Jun 05 '25 11:06 Shai-Shillo