🔴 Required Information
Describe the Bug:
In ADK 2.0, importing google.adk.skills fails at application startup when the skills package is used without installing the optional dependency group all.
The module google/adk/skills/_utils.py imports Google Cloud Storage unconditionally:
from google.cloud import storage
However, google-cloud-storage>=2.18,<4 is only declared under optional-dependencies.all in pyproject.toml, not as a required dependency for the core package or for using google.adk.skills.
As a result, any application importing google.adk.skills crashes with:
ImportError: cannot import name 'storage' from 'google.cloud' (unknown location)
This happens even if the application does not explicitly use Google Cloud Storage functionality.
Steps to Reproduce:
- Install ADK 2.0 without optional dependencies:
pip install google-adk==2.0.0
- Create or run an ADK application that imports or uses
google.adk.skills, for example:
from google.adk.skills import models
-
Start the application.
-
Observe that startup fails with an import error caused by google.adk.skills._utils importing google.cloud.storage.
Expected Behavior:
Using google.adk.skills should not require google-cloud-storage unless functionality that actually depends on Google Cloud Storage is used.
Either:
google-cloud-storage should be declared as a required dependency if google.adk.skills always needs it, or
- the import should be lazy/optional and only executed when GCS-related functionality is used, with a clear error message if the dependency is missing.
Observed Behavior:
The application fails during startup when importing google.adk.skills, because google.cloud.storage is imported unconditionally although google-cloud-storage is only an optional dependency.
Stack trace:
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/google/adk/skills/__init__.py", line 20, in <module>
from ._utils import _list_skills_in_dir as list_skills_in_dir
File "/app/.venv/lib/python3.12/site-packages/google/adk/skills/_utils.py", line 27, in <module>
from google.cloud import storage
ImportError: cannot import name 'storage' from 'google.cloud' (unknown location)
Environment Details:
- ADK Library Version
(pip show google-adk): 2.0.x
- Desktop OS:
Linux / Docker container
- Python Version
(python -V): Python 3.12
Model Information:
- Are you using LiteLLM:
N/A
- Which model is being used:
N/A
🟡 Optional Information
Regression:
Yes, 1.34.0 didn't have this problem
Logs:
N/A
Screenshots / Video:
N/A
Additional Context:
The dependency google-cloud-storage>=2.18,<4 appears to be listed only under optional-dependencies.all in pyproject.toml, but google.adk.skills._utils imports it at module import time.
This makes google-cloud-storage effectively required for importing google.adk.skills, even when no Google Cloud Storage related functionality is used.
Possible fixes:
- Move
google-cloud-storage>=2.18,<4 to required dependencies if skills always depends on it.
- Add a dedicated optional extra for skills, for example:
[project.optional-dependencies]
skills = ["google-cloud-storage>=2.18,<4"]
- Make the import lazy inside the functions that actually require GCS and raise a clear dependency error only when those functions are used.
Minimal Reproduction Code:
from google.adk.skills import models
print("Imported google.adk.skills successfully")
Run with:
pip install google-adk==2.0.*
python reproduce.py
Expected result:
Imported google.adk.skills successfully
Actual result:
ImportError: cannot import name 'storage' from 'google.cloud' (unknown location)
How often has this issue occurred?:
🔴 Required Information
Describe the Bug:
In ADK 2.0, importing
google.adk.skillsfails at application startup when theskillspackage is used without installing the optional dependency groupall.The module
google/adk/skills/_utils.pyimports Google Cloud Storage unconditionally:However,
google-cloud-storage>=2.18,<4is only declared underoptional-dependencies.allinpyproject.toml, not as a required dependency for the core package or for usinggoogle.adk.skills.As a result, any application importing
google.adk.skillscrashes with:This happens even if the application does not explicitly use Google Cloud Storage functionality.
Steps to Reproduce:
google.adk.skills, for example:Start the application.
Observe that startup fails with an import error caused by
google.adk.skills._utilsimportinggoogle.cloud.storage.Expected Behavior:
Using
google.adk.skillsshould not requiregoogle-cloud-storageunless functionality that actually depends on Google Cloud Storage is used.Either:
google-cloud-storageshould be declared as a required dependency ifgoogle.adk.skillsalways needs it, orObserved Behavior:
The application fails during startup when importing
google.adk.skills, becausegoogle.cloud.storageis imported unconditionally althoughgoogle-cloud-storageis only an optional dependency.Stack trace:
Environment Details:
(pip show google-adk):2.0.xLinux / Docker container(python -V):Python 3.12Model Information:
N/AN/A🟡 Optional Information
Regression:
Yes, 1.34.0 didn't have this problem
Logs:
N/A
Screenshots / Video:
N/A
Additional Context:
The dependency
google-cloud-storage>=2.18,<4appears to be listed only underoptional-dependencies.allinpyproject.toml, butgoogle.adk.skills._utilsimports it at module import time.This makes
google-cloud-storageeffectively required for importinggoogle.adk.skills, even when no Google Cloud Storage related functionality is used.Possible fixes:
google-cloud-storage>=2.18,<4to required dependencies ifskillsalways depends on it.Minimal Reproduction Code:
Run with:
pip install google-adk==2.0.* python reproduce.pyExpected result:
Actual result:
How often has this issue occurred?: