adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Cannot run an agent by following the quickstart

Open hh54188 opened this issue 1 year ago • 3 comments

I follow the quickstart to write a demo, there is my folder structure:

backend/agents/
├──.venv/
├── creator_checker/
│   ├── __init__.py
│   ├── agent.py

and here is my code:

from google.adk.agents.llm_agent import Agent

root_agent = Agent(
    model='gemini-2.5-flash',
    name='creator_checker',
    description='A helpful assistant for user questions.',
    instruction='Answer user questions to the best of your knowledge',
)

And when I try to the agent in the agents folder with the command adk run creator_checker, I met this error:

ValueError: App name mismatch detected. The runner is configured with app name "creator_checker", but the root agent was loaded from "\backend\agents.venv", which implies app name ".venv". Rename the App or its directory so the names match before running the agent.

What's wrong ith my code?


Actually the quickstart doc was so clear:

Install ADK by running the following command:

Which folder? The agent folder or the parent folder?

Run your agent using the adk run command-line tool.

Also which folder?

Also I found if I run the code in my Windows 10 system, it require admin access which doesn't mentioned in the doc

hh54188 avatar Oct 11 '25 12:10 hh54188

The error is reproducible when you run the same in the agent folder, the code will work when you run it in the parent folder.

kronos3610 avatar Oct 12 '25 02:10 kronos3610

https://github.com/google/adk-python/blob/af74eba695c7f4d4b811ed4e4f26221994fc4cb6/src/google/adk/runners.py#L240

You can rename the folder agents->'other name' for temporarily

Fengrui-Liu avatar Oct 18 '25 15:10 Fengrui-Liu

Hi, there are a changes coming to fix in the newest release! https://github.com/google/adk-python/commit/dc4975dea9fb79ad887460659f8f397a537ee38f https://github.com/google/adk-python/commit/dc4975dea9fb79ad887460659f8f397a537ee38f, please reopen if these issues come back up after the newest release!

GWeale avatar Oct 22 '25 20:10 GWeale