Graph create node error

I'm trying the following:

from py2neo import Graph, Node
graph = Graph() #1
alice = Node("Person", name="Alice")
graph.create(alice)

I get the following error when I turn authentication off
Traceback (most recent call last):
File "", line 1, in
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 706, in create
statement = CreateStatement(self)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/cypher/create.py", line 44, in init
self.supports_node_labels = self.graph.supports_node_labels
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 1080, in supports_node_labels
return self.neo4j_version >= (2, 0)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 958, in neo4j_version
return version_tuple(self.resource.metadata["neo4j_version"])
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 213, in metadata
self.get()
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 267, in get
raise_from(self.error_class(message, **content), error)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/util.py", line 235, in raise_from
raise exception
py2neo.error.GraphError: HTTP GET returned response 404

At 1 if I do the following
graph = Graph("http://neo4j:mypwd@127.0.0.1:7474/db/data")

I get the following error:

Traceback (most recent call last):
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 258, in get
response = self.__base.get(headers=headers, redirect_limit=redirect_limit, **kwargs)
File "/Users/johnnyv/Library/Python/3.7/lib/python/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 "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/packages/httpstream/http.py", line 943, in __get_or_head
return rq.submit(redirect_limit=redirect_limit, **kwargs)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/packages/httpstream/http.py", line 452, in submit
return Response.wrap(http, uri, self, rs, **response_kwargs)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/packages/httpstream/http.py", line 489, in wrap
raise inst
py2neo.packages.httpstream.http.ClientError: 404 Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 706, in create
statement = CreateStatement(self)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/cypher/create.py", line 44, in init
self.supports_node_labels = self.graph.supports_node_labels
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 1080, in supports_node_labels
return self.neo4j_version >= (2, 0)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 958, in neo4j_version
return version_tuple(self.resource.metadata["neo4j_version"])
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 213, in metadata
self.get()
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/core.py", line 267, in get
raise_from(self.error_class(message, **content), error)
File "/Users/johnnyv/Library/Python/3.7/lib/python/site-packages/py2neo/util.py", line 235, in raise_from
raise exception
py2neo.error.GraphError: HTTP GET returned response 404

Can you help?

Which Neo4j version and which py2neo version you're on?

Thanks

neo4j is 1.7.2
py2neo is 2.0.8

I really doubt you're on Neo4j 1.7.2 - that version is ~8 years old.

I executed the command pip list. Here are the entries

py2neo 2.0.8
neo4j 1.7.2

Ideas?

I did ask about the Neo4j version you're using, not the version of the driver.

If you mean Neo4j desktop, it's 1.2.7.

If that's not correct, let me know how to provide the info you need.

Screen Shot 2020-05-11 at 8.25.38 AM

So inside Neo4j you can run multiple databases, each can have it's own version. So what Neo4j version you're using?

Can you help me to get the information you need? Is there a command I can run, or series of actions/click to get you the information?

call dbms.components()

"Neo4j Kernel" ["4.0.3"] "community"

Your py2neo version doesn't work with Neo4j 4.0 since the HTTP endpoints have changed.

There's a pre-release available, see https://py2neo.org/v5/. To install it: pip install py2neo==5.0b1

That works! Thanks for your help and time.

1 Like