llama_index [Bug]:初始化neo4j时出错

vngu2lb8  于 3个月前  发布在  其他
关注(0)|答案(2)|浏览(39)

Bug Description

我按照his instructions的步骤操作,但是无法导入'Neo4jGraphStore':

from llama_index.graph_stores.neo4j import Neo4jGraphStore
ImportError: cannot import name 'Neo4jGraphStore' from partially initialized module 'llama_index.graph_stores.neo4j' (most likely due to a circular import) (C:\Users\cpdft.conda\envsllamaindex\lib\site-packages\llama_index\graph_stores
eo4j_*init*_.py)

Version

0.10.55

Steps to Reproduce

from llama_index.core import KnowledgeGraphIndex, SimpleDirectoryReader
from llama_index.core import StorageContext
from llama_index.graph_stores.neo4j import Neo4jGraphStore

# initializing neo4j

graph_store = Neo4jGraphStore(
 username=username,
 password=password,
 url=url,
 database=database,
)

Relevant Logs/Tracbacks

from llama_index.core import KnowledgeGraphIndex, SimpleDirectoryReader
from llama_index.core import StorageContext
from llama_index.graph_stores.neo4j import Neo4jGraphStore

# initializing neo4j
graph_store = Neo4jGraphStore(
    username=username,
    password=password,
    url=url,
    database=database,
)

ImportError: cannot import name 'Neo4jGraphStore' from partially initialized module 'llama_index.graph_stores.neo4j' (most likely due to a circular import) (C:\Users\cpdft.conda\envs\llamaindex\lib\site-packagesllama_index\graph_stores
eo4j_init_.py)

bcs8qyzn

bcs8qyzn1#

你好!我在这里帮助你解决在等待人工维护者时遇到的任何错误、问题或贡献。
你遇到的错误是由于 llama_index 库中的循环导入问题导致的。这是一个已知的问题。要解决这个问题,你可以尝试以下步骤:

  1. 确保已安装正确版本的 neo4j:
pip install neo4j
  1. 检查循环导入:有时,重新组织你的导入语句可以帮助避免循环导入问题。尝试在代码的不同位置导入 Neo4jGraphStore,或者确保没有其他导入导致循环依赖。
  2. 使用正确的导入路径:Neo4jGraphStore 的导入路径应该是:
from llama_index.graph_stores.neo4j import Neo4jGraphStore

如果问题仍然存在,可能与 llama_index 库中已知的循环导入问题有关。不幸的是,在提供的上下文中没有提到特定于此问题的解决方法。你可能需要等待维护者的修复或检查库中是否有任何更新可以解决此问题 1(https://github.com/run-llama/llama_index/blob/main/docs/docs/examples/discover_llamaindex/document_management/discord_dumps/help_channel_dump_06_02_23.json)。
目前,请确保你的环境设置正确,并使用所需包的最新版本。

  • 要继续与 Dosu 交谈,请提及 @dosu。*
mtb9vblg

mtb9vblg2#

我认为llama-index或其他软件包版本之间存在不匹配。

相关问题