Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-29-2019 06:22 PM
Hi,
The data science class teaches how to integrate and setup the development environment for a Sandbox. How can I replicate the same for a Neo4J Desktop based graph database for the community edition?
08-30-2019 02:13 AM
Not sure I understand the question, but here's an example of connecting to a neo4j database from a notebook in Binderhub: https://mybinder.org/v2/gh/psychemedia/binder-neo4j/master?filepath=py%2Fneo4j-demo.py
Via: https://blog.ouseful.info/2019/08/13/neo4j-graph-database-running-in-mybinder/
08-30-2019 03:01 AM
In general, just connect with the python driver to that database, with bolt://host:port + username + password.
08-30-2019 04:49 PM
I am using the following:
graph = Graph("bolt://host:7473", auth=("neo4j", ""))
Also tried the other variation:
graph = Graph("bolt://localhost:7473", auth=("neo4j", "<Password"))
Moreover, did try the bolt port, https port and http port. Could you advise which one to use.
I am getting the following error:
KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/py2neo/database.py in new(cls, uri, **settings)
87 try:
---> 88 inst = cls._instances[key]
89 except KeyError:
KeyError: 'ff568088721569ea47d3734156837aa1'
During handling of the above exception, another exception occurred:
ServiceUnavailable Traceback (most recent call last)
10 frames
/usr/local/lib/python3.6/dist-packages/neo4j/bolt/connection.py in _connect(resolved_address, **config)
582 _force_close(s)
583 if error.errno in (61, 99, 111, 10061):
--> 584 raise ServiceUnavailable("Failed to establish connection to {!r} (reason {})".format(resolved_address, error.errno))
585 else:
586 raise
ServiceUnavailable: Failed to establish connection to ('::1', 7474, 0, 0) (reason 99)
08-30-2019 05:29 PM
Bolt port is. 7687 not one of those you used.
08-30-2019 07:01 PM
graph = Graph("bolt://localhost:7687", auth=("neo4j", "Jaipur@92"))
I used this and still getting the error
08-31-2019 04:20 AM
And your notebook server is running locally?
and you imported the python-driver or py2neo dependency?
and installed into your notebook?
08-31-2019 12:41 PM
I am using the online Jupyter notebook through Google colab.
Yes the other drivers are installed using the following commands:
!pip install py2neo==4.1.3 pandas matplotlib sklearn
from py2neo import Graph
09-02-2019 08:52 AM
What is the current error message.
09-02-2019 03:10 PM
KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/py2neo/database.py in new (cls, uri, **settings)
87 try:
---> 88 inst = cls._instances[key]
89 except KeyError:
KeyError: 'ff568088721569ea47d3734156837aa1'
During handling of the above exception, another exception occurred:
ServiceUnavailable Traceback (most recent call last)
10 frames
/usr/local/lib/python3.6/dist-packages/neo4j/bolt/connection.py in _connect(resolved_address, **config)
582 _force_close(s)
583 if error.errno in (61, 99, 111, 10061):
--> 584 raise ServiceUnavailable("Failed to establish connection to {!r} (reason {})".format(resolved_address, error.errno))
585 else:
586 raise
ServiceUnavailable: Failed to establish connection to ('::1', 7474, 0, 0) (reason 99)
09-02-2019 04:25 PM
But that's again the wrong port in your connection URL.
ServiceUnavailable: Failed to establish connection to ('::1', 7474, 0, 0) (reason 99)
can you make sure you fix all connection URL places first?
09-02-2019 10:30 PM
KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/py2neo/database.py in new(cls, uri, **settings)
87 try:
---> 88 inst = cls._instances[key]
89 except KeyError:
KeyError: '7e4b1ff0930024bc0b8c7e1d27464215'
During handling of the above exception, another exception occurred:
ServiceUnavailable Traceback (most recent call last)
10 frames
/usr/local/lib/python3.6/dist-packages/neo4j/bolt/connection.py in _connect(resolved_address, **config)
582 _force_close(s)
583 if error.errno in (61, 99, 111, 10061):
--> 584 raise ServiceUnavailable("Failed to establish connection to {!r} (reason {})".format(resolved_address, error.errno))
585 else:
586 raise
ServiceUnavailable: Failed to establish connection to ('::1', 7687, 0, 0) (reason 99)
09-03-2019 06:05 AM
Looks like an ipv6 issue?
Can yo check in your /etc/hosts what the entry is for localhost and possible add 127.0.0.1
09-03-2019 03:27 PM
I got the following error when I used graph = Graph("bolt://127.0.01:7687", auth=("neo4j", "Jaipur@92"))
KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/py2neo/database.py in new(cls, uri, **settings)
87 try:
---> 88 inst = cls._instances[key]
89 except KeyError:
KeyError: '5ec4cbd7df2b4ae5c9bc45421a11ca50'
During handling of the above exception, another exception occurred:
ServiceUnavailable Traceback (most recent call last)
10 frames
/usr/local/lib/python3.6/dist-packages/neo4j/bolt/connection.py in _connect(resolved_address, **config)
582 _force_close(s)
583 if error.errno in (61, 99, 111, 10061):
--> 584 raise ServiceUnavailable("Failed to establish connection to {!r} (reason {})".format(resolved_address, error.errno))
585 else:
586 raise
ServiceUnavailable: Failed to establish connection to ('127.0.0.1', 7687) (reason 111)
When I click on local host in Neo4J desktop I get the following:
Browser URL: http://localhost:7474/browser/
Connect URL: bolt://localhost:7687
I am not getting anything when I am using the following command:
graph = Graph("http://localhost:7474/browser/", auth=("neo4j", "Jaipur@92"))
09-05-2019 12:21 PM
Have an example jupyter notebook hooked up to neo4j as part of the walkscore neo4j demo that might help - although it may be using an older python library as it was done last year: https://github.com/menome/neo4j-spatial-experiments/tree/master/1_walkscore
04-07-2020 09:55 PM
I am trying the following code to connect Neo4j desktop using python
from neo4j import GraphDatabase
url = "bolt://localhost:7687"
driver = GraphDatabase.driver(url, auth=("neo4j", ""))
But getting this error "Failed to establish connection to ('::1', 7687, 0, 0) (reason [Errno 61] Connection refused)"
Can anyone please suggest what should i change in my code
04-08-2020 04:39 AM
Hello Swati,
So you have a Neo4j instance running locally on your system yes?
If so, it should have been created with a password and the driver() call here has blank for the password which is not correct.
Do you remember what password you used when you created the graph?
You must supply that password here.
Elaine
06-03-2021 02:47 AM
Hey I am not sure but according to my research as google colab is a cloud-based service it does not support importing data from a local db but if you want to setup a system in a local jupyter notebook here is the code I used, I used py2neo driver for my connection.
from py2neo import Graph
graph = Graph("bolt://localhost:7687", auth=("neo4j", "yelp"))
result=graph.run("MATCH (n:User) RETURN n LIMIT 25")
All the sessions of the conference are now available online