I am trying to deploy a very simple ADK agent into agent engine. as per below code:
from google.adk.agents import Agent from google.adk.tools import google_search from dotenv import load_dotenv
load_dotenv()
# Define the agent
root_agent = Agent(
name="google_news_agent",
model="gemini-2.5-flash",
instruction="Look for all the latest news in the internet and provide a crisp summary based on the topic",
description="An agent that uses Google Search to fetch up-to-date news",
#tools=[google_search] # Built-in Google Search tool
)
# To run locally, use ADK CLI:
# > adk run google_search_agent
my .env file
# If using Gemini via Vertex AI on Google CLoud
GOOGLE_CLOUD_PROJECT="<my-project>"
GOOGLE_CLOUD_LOCATION="us-central1"
GOOGLE_GENAI_USE_VERTEXAI="True"
my init.py file
from . import agent
I am using below deployment command to deploy my agent to agnet engine.
adk deploy agent_engine academic_research \
--project="<my-project-id> \
--region="us-central1" \
--staging_bucket="gs://adk-agent-deploy-bucket" \
--display_name="academic_research"
However when deploying, it is giving below error:
Traceback (most recent call last): AttributeError: 'ModuleAgent' object has no attribute 'agent_framework
I tried using github agent deployment as well, which failed with same error. Can someone help me with this?
I just created a venv and performed everything again. It worked. Must have been some library mismatch.