cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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'

3 REPLIES 3

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: https://py2neo.org/v4/database.html

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

That's right. Thank you for your comment!