I was trying to connect neo4j by py2neo. But got some errors saying hostname or nodename not found...... I tried the below codes to connect but neither was working
graph = Graph()
#graph = Graph("http://username:password@localhost:7474/db/data/")
However, I could use browser to connect to the URL with the credential.
The below is the error message I got. Can someone help me with this?
File "test.py", line 56, in main
graph = Graph()
File "/anaconda2/lib/python2.7/site-packages/py2neo/database/__init__.py", line 327, in __new__
use_bolt = version_tuple(inst.__remote__.get().content["neo4j_version"]) >= (3,)
File "/anaconda2/lib/python2.7/site-packages/py2neo/database/http.py", line 154, in get
response = self.__base.get(headers=headers, redirect_limit=redirect_limit, **kwargs)
File "/anaconda2/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 "/anaconda2/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 "/anaconda2/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 "/anaconda2/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 342, in submit
raise NetworkAddressError(err.args[1], host_port=uri.host_port)
py2neo.packages.httpstream.http.NetworkAddressError: nodename nor servname provided, or not known: localhost:7474