py2neo出现'Graph' object has no attribute 'find_one'

原因:py2neo的v2和v3版本有两个很简便的查找节点的函数find_one()和find(),但是在v4版本里面不见了。

现在查找节点的操作是这样子的:

from py2neo import Graph, NodeMatcher
graph = Graph()
matcher = NodeMatcher(graph)
matcher.match("Person", name="Keanu Reeves").first()
(_224:Person {born:1964,name:"Keanu Reeves"})

官方文档在这里:https://py2neo.org/v4/index.html

你可能感兴趣的:(Python)