我有下面的neo4j测试代码
from py2neo import Graph
neo_user = 'neo4j'
neo_pass = '321'
neo_port = 7474
neo_host = '0.0.0.0'
neo_bolt_port = 7687
graph = Graph(host=neo_host, http_port=neo_port, user=neo_user, password=neo_pass, bolt_port=neo_bolt_port,bolt=True)
def test():
graph.run("match(n) where n.module_flag = 'sb' return n")
print "done"
它显示以下错误
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "neotest.py", line 13, in test
graph.run("match(n) where n.module_flag = 'xx' return n")
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/database/__init__.py", line 731, in run
return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/database/__init__.py", line 370, in begin
return self.transaction_class(self, autocommit)
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/database/__init__.py", line 1249, in __init__
self.session = driver.session()
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/session.py", line 126, in session
connection = connect(self.address, self.ssl_context, **self.config)
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 482, in connect
return Connection(s, der_encoded_server_certificate=der_encoded_server_certificate, **config)
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 241, in __init__
self.fetch()
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 337, in fetch
self.acknowledge_failure()
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 284, in acknowledge_failure
fetch()
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 322, in fetch
raw.writelines(self.channel.chunk_reader())
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 173, in chunk_reader
chunk_header = self._recv(2)
File "/home/ec2-user/pyenv/local/lib/python2.7/site-packages/py2neo/packages/neo4j/v1/bolt.py", line 151, in _recv
b = self.socket.recv(8192)
socket.error: [Errno 104] Connection reset by peer
如果我删除“ bolt = True”,一切正常。
名称:py2neo 版本:3.1.2
名称:neo4j-driver 版本:1.2.0
名称:pip 版本:18.0
Neo4j版本3.1.1