Run() missing 1 required positional argument: 'cypher'

Hello all,

I have a graph that I want to query. I am using py2neo to do the task. However, when I ran the query, It results in the following error even though I installed the stable release.

Graph.run("MATCH (a) WHERE n.name=$x RETURN n.id, labels(n)", x="Length").evaluate()

Traceback (most recent call last):

File "", line 1, in

TypeError: run() missing 1 required positional argument: 'cypher'

Did the question text box capitalize the G in Graph or is this the way it is written in your code? Graph is the name of the class you import from py2neo. The run method should be called on an instance of Graph, not directly on the class name.
See here for an example: 2. py2neo.database – Graph Databases — The Py2neo v4 Handbook

1 Like

Shouldn't your query be MATCH (n) not MATCH (a) as you use n. in the rest of the query?

2 Likes

That's right. Thank you for your comment!