[Bug]: Missing dependencies for A2AClient (googleapis-common-protos, grpcio, protobuf)
RubberGoose246 opened this issue · 2 comments
What happened?
Starting from version 0.2.14, it seems that the dependencies required for using A2AClient - namely googleapis-common-protos, grpcio, and protobuf — are no longer installed automatically.
As a result, importing A2AClient now causes ModuleNotFoundError unless these packages are installed manually.
These dependencies may need to be added back to the installation requirements.
Relevant log output
(.venv_a2a_0_2_14) C:\path\to>python file.py
Traceback (most recent call last):
File "C:\path\to\file.py", line 8, in <module>
from a2a.client import A2AClient
File "C:\path\to\.venv_a2a_0_2_14\Lib\site-packages\a2a\client\__init__.py", line 15, in <module>
from a2a.client.grpc_client import A2AGrpcClient
File "C:\path\to\.venv_a2a_0_2_14\Lib\site-packages\a2a\client\grpc_client.py", line 5, in <module>
import grpc
ModuleNotFoundError: No module named 'grpc'
(.venv_a2a_0_2_14) C:\path\to>pip show a2a-sdk
Name: a2a-sdk
Version: 0.2.14
Summary: A2A Python SDK
Home-page: https://a2a-protocol.org/
Author:
Author-email: Google LLC <googleapis-packages@google.com>
License:
Location: C:\path\to\.venv_a2a_0_2_14\Lib\site-packages
Requires: fastapi, httpx, httpx-sse, opentelemetry-api, opentelemetry-sdk, pydantic, sse-starlette, starlette
Required-by:
(.venv_a2a_0_2_14) C:\path\to>python --version
Python 3.12.7
(.venv_a2a_0_2_13) C:\path\to>pip show a2a_sdk
Name: a2a-sdk
Version: 0.2.13
Summary: A2A Python SDK
Home-page: https://a2a-protocol.org/
Author:
Author-email: Google LLC <googleapis-packages@google.com>
License:
Location: C:\path\to\.venv_a2a_0_2_13\Lib\site-packages
Requires: fastapi, google-api-core, grpcio, grpcio-reflection, grpcio-tools, httpx, httpx-sse, opentelemetry-api, opentelemetry-sdk, protobuf, pydantic, sse-starlette, starlette
Required-by:Code of Conduct
- I agree to follow this project's Code of Conduct
This was an intentional change for grpc use cases.
These now need to be installed with pip install "a2a-sdk[grpc]" See https://github.com/a2aproject/a2a-python/releases/tag/v0.2.14
Are you experiencing this even when you're not trying to use gRPC?
Update: I was able to reproduce and resolve the issue. #322 made the grpc imports optional, but didn't add proper handling on the client side to prevent these import errors when not using grpc.
#330 added the handling on the client side, which was released in 0.2.15 I will be yanking the 0.2.14 release.
NOTE: to use the grpc client/server, you will still need to install using pip install "a2a-sdk[grpc]"
Thanks for notifying us of the issue.