😎

【GraphRAG】- No module named graphrag.index.__main__; の対処方法

2025/01/27に公開

執筆日

2025/1/27

発生事象

GrapghRAGのプロジェクトの初期化をする際に、以下のエラーが。

>python -m graphrag.index --init --root ./
No module named graphrag.index.__main__; 'graphrag.index' is a package and cannot be directly executed

原因

graphragのバージョンが原因でした。

graphrag==1.2.0

対処方法

GraphRAG == 0.4.0以上の場合は、以下のコマンドで実施する。

  • ワークスペース初期化
graphrag init --root ./
  • index作成
graphrag index --root ./  
  • 検索
graphrag query --root .\ --method <global or local> --query <プロンプト>
ヘッドウォータース

Discussion