graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

How to use the index_cli in pycharm

Open lishaozheng opened this issue 7 months ago • 2 comments

Describe the issue

raise ImportError(

ImportError: Unable to import required dependencies: numpy: cannot import name 'NamedTuple' from partially initialized module 'typing' (most likely due to a circular import) (G:\LiProbject\project\graphrag\graphrag\index\typing.py)

Steps to reproduce

Copyright (c) 2024 Microsoft Corporation.

Licensed under the MIT License

"""The Indexing Engine package root."""

import argparse

from graphrag.index.cli import index_cli

from .cli import index_cli

if name == "main": parser = argparse.ArgumentParser() # Add the same arguments as shown in your provided code snippet

args = parser.parse_args([
    "--root", "./ragtest",
    # Add other arguments as needed
])

index_cli(
    root=args.root,
    verbose=args.verbose or False,
    resume=args.resume,
    memprofile=args.memprofile or False,
    nocache=args.nocache or False,
    reporter=args.reporter,
    config=args.config,
    emit=args.emit,
    dryrun=args.dryrun or False,
    init=args.init or False,
    overlay_defaults=args.overlay_defaults or False,
    cli=True,
)

GraphRAG Config Used

No response

Logs and screenshots

Traceback (most recent call last): File "G:\LiProbject\project\graphrag\graphrag\index_main_.py", line 8, in from graphrag.index.cli import index_cli File "G:\LiProbject\project\graphrag\graphrag\index_init_.py", line 6, in from .cache import PipelineCache File "G:\LiProbject\project\graphrag\graphrag\index\cache_init_.py", line 6, in from .json_pipeline_cache import JsonPipelineCache File "G:\LiProbject\project\graphrag\graphrag\index\cache\json_pipeline_cache.py", line 7, in from typing import Any File "G:\LiProbject\project\graphrag\graphrag\index\typing.py", line 9, in import pandas as pd File "I:\ProgramData\anaconda3\envs\grag\lib\site-packages\pandas_init_.py", line 32, in raise ImportError( ImportError: Unable to import required dependencies: numpy: cannot import name 'NamedTuple' from partially initialized module 'typing' (most likely due to a circular import) (G:\LiProbject\project\graphrag\graphrag\index\typing.py)

Additional Information

  • GraphRAG Version:
  • Operating System:
  • Python Version:
  • Related Issues:

lishaozheng avatar Jul 10 '24 10:07 lishaozheng