Skip to content

Missing dependency google-cloud-storage for skills in V2.0.0 #5801

@mariokorte

Description

@mariokorte

🔴 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:

  1. Install ADK 2.0 without optional dependencies:
pip install google-adk==2.0.0
  1. Create or run an ADK application that imports or uses google.adk.skills, for example:
from google.adk.skills import models
  1. Start the application.

  2. 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:

  1. Move google-cloud-storage>=2.18,<4 to required dependencies if skills always depends on it.
  2. Add a dedicated optional extra for skills, for example:
[project.optional-dependencies]
   skills = ["google-cloud-storage>=2.18,<4"]
  1. 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?:

  • Always (100%)

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions