报错内容:
Traceback (most recent call last):
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 205, in __init__
self.refresh_schema()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 248, in refresh_schema
for el in self.query(
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 232, in query
data = session.run(Query(text=query, timeout=self.timeout), params)
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/work/session.py", line 313, in run
self._auto_result._run(
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/work/result.py", line 181, in _run
self._attach()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/work/result.py", line 301, in _attach
self._connection.fetch_message()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_common.py", line 178, in inner
func(*args, **kwargs)
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_bolt.py", line 849, in fetch_message
res = self._process_message(tag, fields)
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_bolt4.py", line 368, in _process_message
response.on_failure(summary_metadata or {})
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/neo4j/_sync/io/_common.py", line 245, in on_failure
raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.ClientError: {code: Neo.ClientError.Procedure.ProcedureNotFound} {message: There is no procedure with the name `apoc.meta.data` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/langchain-master/templates/neo4j-semantic-ollama/ingest.py", line 9, in <module>
graph = Neo4jGraph()
File "/root/anaconda3/envs/sakura/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py", line 208, in __init__
raise ValueError(
ValueError: Could not use APOC procedures. Please ensure the APOC plugin is installed in Neo4j and that 'apoc.meta.data()' is allowed in Neo4j configuration
报错原因
没有安装APOC插件
解决方案
我的neo4j
版本为5.17.0
,可以安装最新的5.17.1
的neo4j-apoc-procedures
可以看到最新的版本对LLM的支持比较好
从网上搜索的资料和GitHub官网可以看到需要下载apoc-<version>-all.jar
包移动到$NEO4J_HOME/plugins/
但是5.17.1
中没有这个包
尝试按照上上一个图片中的Build & install the current development branch from source的方式源码编译
下载了半个小时,编译了20多分钟,放弃了
更换neo4j版本为4.4.30
安装方式参考
最终得到如下版本信息
# java --version
java 11.0.22 2024-01-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.22+9-LTS-219)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.22+9-LTS-219, mixed mode)
# neo4j --version
neo4j 4.4.30
在这里找到apoc-4.4.0.25-all.jar
,单击下载
上传到$NEO4J_HOME/plugins/
启动neo4j
neo4j start
打开网页输入
RETURN apoc.version();
得到版本信息==成功