I have tried accessing my neo4j graph database through Jupyter Notebook and VSCode using both py2neo and GraphDatabase drivers.
Somehow it always says connection not found. I am using Neo4j desktop, and starting the local dbms and neo4j browser. When I try either:
- Graph("bolt://localhost:7687", auth = ("neo4j","password"))
It shows connection is closed or not established. I have tried reading through so many resources but there is no clear and concise correction. I read somewhere that the neo4j instance has to run on the same server as the python code - but how does this work and what can I do to rectify this problem ?
Maybe a silly question, but are you sure the database is running?
Here is my environment.
Install py2neo into my project.
$ pip install py2neo
I created a simple code.
from py2neo import Graph
graph = Graph("bolt://localhost:7687", auth=("neo4j", "hogehoge"))
result = graph.run("MATCH (n:Movie) RETURN n.title LIMIT 3")
It worked and 3 titles were displayed.
I have some videos showing how to use each driver in the Bite-Sized Neo4j for Data Scientists series. I also have a blog post about it that you can find here.
Hi Andy, I am sure the database is running. I have the neo4j browser open and it shows connected as well
Dear Koji, this is the exact same thing that I tried to run. However at the graph command it shows me an error and says connection has been closed or connection unavailable. If I am not wrong all I have to do with my neo4j desktop app is start the local dbms and open the browser right? I tried editing the config file also but It didn't work.
Thanks for your help. I was actually following your videos, however for some reason it didn't work. I haven't used sandbox btw, I am using desktop. Any ideas on what I can do?
From the error, it seems that the password is wrong.
Is the "neo4j" password "password" ?
graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"))
I resolved the error somehow. The password was indeed "password" but I don't know why it wasn't working. However, when I open the browser through the http protocol in safari, it started working.