How to install neo4j for Python/Jupyter Lab?

  1. Launch anconda (i use this) and launch notebook
  2. Launch Neo4j Desktop and start a database you want to connect to.
  3. IN the Jupyter notebook. (basically installs py2neo into your environment)
    Type our the following in separate lines to first install py2neo, then import the library and finally use the features. How to use the full features of py2neo is available in the py2neo documentation above.
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.