raise ServiceUnavailable(str(error)) from error neo4j.exceptions.ServiceUnavailable: The Neo4J server does not support
communication with this driver. This driver have support for Bolt
Protocols dict_keys([Version(3, 0), Version(4, 0)])
python访问Neo4j有两种方式:
1,python的py2neo模块
from py2neo import Graph
class Init_Neo4j_driver:
def init(self,uri,user,password):
self.driver = Graph(uri,auth = (user,password))
print('链接数据库成功......')
neo4j_driver = Init_Neo4j_driver(“bolt://127.0.0.1:7687”, “neo4j”, “neo4j”)
driver = neo4j_driver.driver
cql = “MATCH (n) RETURN n.name”
data= driver.run(cql).data()
就可以得到想要的数据了
2,python的neo4j模块
from neo4j import GraphDatabase
class Init_Neo4j_driver:
def __init__(self,uri,user,password):
self.driver = GraphDatabase.driver(uri,auth=(use