Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-29-2020 10:40 PM
I tried:
pip install neo4j
But it can't find the module:
from neo4j import GraphDatabase
ModuleNotFoundError: No module named 'neo4j'
Solved! Go to Solution.
01-30-2020 11:40 PM
pip install py2neo
from py2neo import Graph
graph = Graph("bolt://localhost:7687", auth=("neo4j", "asdfgh123"))
uery = "MATCH (n) return n"
graph.run(query).data()
This would be the simplest way to connect and retrieve results. Add on queries to run to perform additional steps on your data.
01-29-2020 11:40 PM
01-29-2020 11:47 PM
Thanks, is py2neo the preferred way to interact with neo4j in Python?
01-30-2020 12:38 AM
pip install neo4j
working for me. Check if pip has completed without any error and package is available in site-packages
.
import sys
sys.path
and py2neo is community driver
01-30-2020 12:55 AM
Thanks, the import works fine just using python, but it can't find the package in Jupyter Lab.
01-30-2020 01:18 AM
I've got the import to work in Jupyter Lab by installing jupyterlab in the same conda environment.
The documentation is not clear what to do next, e.g., how to connect to a database, how to create a new database using Cypher. Where can I find good examples?
01-30-2020 01:49 AM
01-30-2020 11:40 PM
pip install py2neo
from py2neo import Graph
graph = Graph("bolt://localhost:7687", auth=("neo4j", "asdfgh123"))
uery = "MATCH (n) return n"
graph.run(query).data()
This would be the simplest way to connect and retrieve results. Add on queries to run to perform additional steps on your data.
01-30-2020 11:50 PM
Thanks, that does it!
The examples I found online just did:
graph = Graph()
and that obviously didn't work.
01-30-2020 11:52 PM
glad that i could of help
All the sessions of the conference are now available online