Neo4j Python Driver Environment

by John Singer November 9, 2020 at 10:42 am

This post is part of a series of posts describing the Neo4j Python graph API. This post describes the Neo4j Python driver environment I’m using to illustrate examples of how to use the Neo4j Python driver to access and manipulate graph data. The posts use python scripts running in Idle to illustrate different concepts.

To create the environment I’m using you only need to do a few things.

  • Download and install the Neo4j Desktop. This is easy to do and best of all it’s free.
  • Create a sample Neo4j server using the Neo4j Desktop. The Neo4j website has plenty of how to instructions.
  • Download and install the latest version of Python. I’m running Windows and used the current version from python.org.
  • Create a python “environment”
	python -m venv C:\Users\XXXX\PythonEnvV4Test
  • Install the Python driver for Neo4j.
	Pip install neo4j

That’s it! You’re python lib/site-packages folder should have the Neo4j driver package installed. The Neo4j Python Driver Environment is complete.

Of course your environment may differ from mine (MacOS, Linux) and you might prefer one of the many python variants and package managers but the general idea is to end up with a python installation that has the python driver installed and also the Idle python editor. You can use any python IDE if you like but the output from running the scripts might be different from what I show.

To verify your installation start Idle and in the interactive mode do the following import.

from neo4j import GraphDatabase

If this works you should be good to go.

To get started visit the first post in the series – How To Connect To Neo4j Using The Native Python Driver.

Add Comment