Skip to content

run Autogen and GraphRAG sample, report error: ModuleNotFoundError: No module named 'graphrag.config.config_file_loader' #6201

@cyberflying

Description

@cyberflying

What happened?

Describe the bug
I want to run the sample followed: https://github.com/microsoft/autogen/blob/main/python/samples/agentchat_graphrag/README.md,
after completed the setup,
when run the command: python app.py
encounter the error:

(autogen) C:\Users\xxx\autogen\autogen\python\samples\agentchat_graphrag>python app.py
Traceback (most recent call last):
  File "C:\Users\xxx\autogen\autogen\python\samples\agentchat_graphrag\app.py", line 10, in <module>
    from autogen_ext.tools.graphrag import (
  File "C:\Users\xxx\AppData\Local\miniconda3\envs\autogen\Lib\site-packages\autogen_ext\tools\graphrag\__init__.py", line 9, in <module>
    from ._global_search import GlobalSearchTool, GlobalSearchToolArgs, GlobalSearchToolReturn
  File "C:\Users\xxx\AppData\Local\miniconda3\envs\autogen\Lib\site-packages\autogen_ext\tools\graphrag\_global_search.py", line 8, in <module>
    from graphrag.config.config_file_loader import load_config_from_file
ModuleNotFoundError: No module named 'graphrag.config.config_file_loader'

To Reproduce

  1. conda create -n test python=3.12 -y
  2. conda activate test
  3. in dir autogen\python\samples\agentchat_graphrag, pip install -r requirements.txt
  4. run the setup steps
  5. python app.py

autogen\python\samples\agentchat_graphrag>conda list graphrag

packages in environment at C:\Users\xxx\AppData\Local\miniconda3\envs\test:

Name Version Build Channel

graphrag 2.1.0 pypi_0 pypi

Expected behavior
A clear and concise description of what you expected to happen.
Image

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Which packages was the bug in?

Python AgentChat (autogen-agentchat>=0.4.0), Python Extensions (autogen-ext)

AutoGen library version.

Python 0.4.9

Other library version.

autogen-ext 0.4.9.3; graphrag 2.1.0

Model used

gpt-4o-2024-08-06

Model provider

Azure OpenAI

Other model provider

No response

Python version

3.12

.NET version

None

Operating system

Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions