py2neo create 报错
代码如下
from py2neo import Graph, Node, Relationship
g = Graph("http://localhost:7474//browser")
n = Node("test", name="test")
try:
g.create(p1)
except Exception as e:
print(e)
运行时g.create(p1)报如下错
py2neo.errors.ProtocolError: Cannot decode response content as JSON
解决方法
连接时指定数据库名称,使用下面的的连接方式
g = Graph("http://localhost:7474//browser", name='neo4j')