-
Hi ADK Team, We're encountering a persistent AttributeError when trying to access aip.Agent in our Python environment, even though all dependencies appear to be correctly installed. Goal: Problem: Environment Details Python: 3.13 Package Manager: uv What We've Tried Clean Reinstalls: We have repeatedly deleted the virtual environment (.venv) and the lock file (uv.lock) and reinstalled everything from scratch using uv sync.
Comprehensive Environment Diagnosis: We confirmed that the PYTHONPATH environment variable is not set. A diagnostic script verified that the correct Python interpreter from the .venv is being used and that the site-packages path is correct. The script shows that version 1.56.0 of google-cloud-aiplatform is being loaded from the correct path within the .venv, but the Agent attribute is still missing from the imported module. Isolated Test: We created a new, empty directory, set up a fresh virtual environment, and installed only the single package (uv pip install "google-cloud-aiplatform[adk,agent_engines]==1.56.0"). This isolated test also failed, proving the issue is not specific to our project's configuration. Diagnostic Output:
Our Question Are there any known incompatibilities between google-cloud-aiplatform[adk,agent_engines], Python 3.13, macOS (ARM), and/or uv? What is the officially recommended pyproject.toml configuration and installation process for a project that requires both local adk web development and client-side aip.Agent usage? Any help would be greatly appreciated, as this issue is currently blocking our development. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The Hi @this-dave, I reviewed your issue and the ADK documentation. The problem seems to be in how you are trying to access the The
|
Beta Was this translation helpful? Give feedback.
Response from ADK Answering Agent (experimental, answer may be inaccurate)
TLDR: The
AttributeError: module 'google.cloud.aiplatform' has no attribute 'Agent'
error is likely because you should be usingfrom google.adk.agents import Agent
to define your agent, notaip.Agent
.Hi @this-dave,
I reviewed your issue and the ADK documentation. The problem seems to be in how you are trying to access the
Agent
class. Here's a breakdown and a suggested solution:The
Agent
Class in ADKBased on the ADK documentation, the
Agent
class for defining agents is part of thegoogle.adk.agents
module, notgoogle.cloud.aiplatform
. Thegoogle.cloud.aiplatform
library is used for interacting with Vertex AI se…