I started a local neo4j server and work with it using Python (PyCharm)
Installed with (python -m pip install --upgrade neo4j==4.0.0
)
Python 3.8
Neo4j 4.0
from neo4j import GraphDatabase, basic_auth driver = GraphDatabase.driver("neo4j://localhost:7687", auth=basic_auth("neo4j", "12345")) session = driver.session() session.run("CREATE (a:Person {name:'Bob'})") result = session.run("MATCH (a:Person) RETURN a.name AS name") for record in result: print(record["name"]) session.close() driver.close()
But when the program starts, it returns an error. What to do?
D:PyCharmprojectsvenvScriptspython.exe add -i D:PyCharmpluginspython-cehelperspydevpydevconsole.py --mode=client --port=52885 D:Pythonpython.exe: can't open file 'add': [Errno 2] No such file or directory Process finished with exit code 2
How can I fix this?
Advertisement
Answer
Probably you have wrong PyCharm Interpreter configuration and/or Run Configuration.
Try running code with console command from Terminal, not from PyCharm.