gpt4 book ai didi

python - Python py2neo SocketError : Connection Refused

转载 作者:行者123 更新时间:2023-12-03 11:59:56 26 4
gpt4 key购买 nike

我正在尝试遵循this neo4j教程,但是在连接到API时遇到问题。这是我的回溯:

>>> graph.delete_all()

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/py2neo/core.py", line 748, in delete_all
statement = StartOrMatch(self).relationship("r", "*").string + "DELETE r"
File "/usr/local/lib/python2.7/site-packages/py2neo/cypher/util.py", line 45, in string
if self.graph.supports_start_clause:
File "/usr/local/lib/python2.7/site-packages/py2neo/core.py", line 1105, in supports_start_clause
return self.neo4j_version < (2, 2)
File "/usr/local/lib/python2.7/site-packages/py2neo/core.py", line 964, in neo4j_version
return version_tuple(self.resource.metadata["neo4j_version"])
File "/usr/local/lib/python2.7/site-packages/py2neo/core.py", line 213, in metadata
self.get()
File "/usr/local/lib/python2.7/site-packages/py2neo/core.py", line 258, in get
response = self.__base.get(headers=headers, redirect_limit=redirect_limit, **kwargs)
File "/usr/local/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 966, in get
return self.__get_or_head("GET", if_modified_since, headers, redirect_limit, **kwargs)
File "/usr/local/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 943, in __get_or_head
return rq.submit(redirect_limit=redirect_limit, **kwargs)
File "/usr/local/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 433, in submit
http, rs = submit(self.method, uri, self.body, self.headers)
File "/usr/local/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 362, in submit
raise SocketError(code, description, host_port=uri.host_port)
py2neo.packages.httpstream.http.SocketError: Connection refused

我是网络/套接字连接的新手,所以对发生的事情进行人类可读的解释将非常有帮助。

最佳答案

您没有显示连接代码(Graph构造函数),也没有提及您的设置,但是导致此错误的常见原因是:(1)服务器未运行,(2)客户端连接到错误的计算机或端口或( 3)客户端和服务器之间有防火墙,阻止访问。

我建议您尝试使用cURL或某些类似工具从命令行连接到服务器,然后确保您的Python代码附加到同一位置。

关于python - Python py2neo SocketError : Connection Refused,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32783174/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com