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
JavaScript
x
13
13
1
from neo4j import GraphDatabase, basic_auth
2
3
driver = GraphDatabase.driver("neo4j://localhost:7687", auth=basic_auth("neo4j", "12345"))
4
session = driver.session()
5
session.run("CREATE (a:Person {name:'Bob'})")
6
result = session.run("MATCH (a:Person) RETURN a.name AS name")
7
8
for record in result:
9
print(record["name"])
10
11
session.close()
12
driver.close()
13
But when the program starts, it returns an error. What to do?
JavaScript
1
4
1
D:PyCharmprojectsvenvScriptspython.exe add -i D:PyCharmpluginspython-cehelperspydevpydevconsole.py --mode=client --port=52885
2
D:Pythonpython.exe: can't open file 'add': [Errno 2] No such file or directory
3
Process finished with exit code 2
4
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.