autogen icon indicating copy to clipboard operation
autogen copied to clipboard

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

Open cyberflying opened this issue 9 months ago • 2 comments

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

cyberflying avatar Apr 04 '25 09:04 cyberflying

pip install graphrag==1.2.0 can fix this issue.

I think "pip install -r requirements.txt" (autogen-ext[graphrag,openai,azure]>=0.4.0,<0.5) will install the latest version graphrag(2.1.0)

cyberflying avatar Apr 04 '25 16:04 cyberflying

Thanks! I think we should update the GraphRAG extension to catch up with the latest version of GraphRAG.

Created issue here: https://github.com/microsoft/autogen/issues/6210

Help appreciated!

ekzhu avatar Apr 04 '25 22:04 ekzhu

autogen-ext: 0.6.1 graphrag: 2.3.0

still not work.....

Image in https://github.com/microsoft/autogen/blob/main/python/packages/autogen-ext/src/autogen_ext/tools/graphrag/_local_search.py

config_file_loader file not exist in https://github.com/microsoft/graphrag/tree/main/graphrag/config

cuckootan avatar Jun 21 '25 08:06 cuckootan

same there. high priority issue

cv-marvin avatar Jun 26 '25 14:06 cv-marvin