py2neo(Neo4j):py2neo.packages.httpstream.http.SocketError:不允许操作

时间:2015-05-24 05:39:47

标签: python neo4j graph-databases py2neo

我在ubuntu Amazon EC2实例中运行Neo4j 2.2.1。当我尝试使用py2neo-2.0.7通过python连接时,我收到以下错误:

py2neo.packages.httpstream.http.SocketError: Operation not permitted

我可以通过http://52.10.**.***:7474/browser/

访问网络界面

代码: -

from py2neo import Graph, watch, Node, Relationship

url_graph_conn = "https://neo4j:password@52.10.**.***:7474/db/data/"
print url_graph_conn
my_conn = Graph(url_graph_conn)
babynames = my_conn.find("BabyName")
for babyname in babynames:
    print 2

错误讯息: -

https://neo4j:password@52.10.**.***:7474/db/data/
Traceback (most recent call last):
  File "C:\Users\rharoon002\eclipse_workspace\peace\peace\core\graphconnection.py", line 39, in <module>
    for babyname in babynames:
  File "C:\Python27\lib\site-packages\py2neo\core.py", line 770, in find
    response = self.cypher.post(statement, parameters)
  File "C:\Python27\lib\site-packages\py2neo\core.py", line 667, in cypher
    metadata = self.resource.metadata
  File "C:\Python27\lib\site-packages\py2neo\core.py", line 213, in metadata
    self.get()
  File "C:\Python27\lib\site-packages\py2neo\core.py", line 258, in get
    response = self.__base.get(headers=headers, redirect_limit=redirect_limit, **kwargs)
  File "C:\Python27\lib\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 "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 943, in __get_or_head
    return rq.submit(redirect_limit=redirect_limit, **kwargs)
  File "C:\Python27\lib\site-packages\py2neo\packages\httpstream\http.py", line 433, in submit
    http, rs = submit(self.method, uri, self.body, self.headers)
  File "C:\Python27\lib\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: Operation not permitted

1 个答案:

答案 0 :(得分:4)

您正尝试通过http(7474)的标准端口上的http s 访问neo4j:

url_graph_conn = "https://neo4j:password@52.10.**.***:7474/db/data/"

http s 连接的标准端口是7473.尝试:

url_graph_conn = "https://neo4j:password@52.10.**.***:7473/db/data/"

并确保您可以通过http s

访问网络界面
https://52.10.**.***:7473/browser/

您可以更改/查看neo4j-server.properties文件中的端口设置。