Creating a Python Driver Instance

I'm following the course Building Neo4j Applications with Python. I am stuck in creating a connection to the Neo4j server at localhost on the default port number of 7687 . When I run 'driver.verify_connectivity()' on Python, I get the 'neo4j.exceptions.ServiceUnavailable: Could not connect to any routing servers' error'. I already tried to change the "neo4j://localhost:7687" port using the instructions in the following link: How to resolve Python Bolt Driver when executed gives an error "("Failed to establish connection to {!r}".format(address))" - Knowledge Base
But nothing change.
Is there someone who can help me?


Hey @a.gennari97 !

This error indicates that the driver can't connect to a server at that address. Do you have a neo4j instance running locally? Can you connect to http://localhost:7474 ? Have you modified neo4j.conf at all?

Thanks Adam for helping me.
Answering your questions:

  1. I didn't download any Neo4j program for desktop, I just installed it through the command 'pip install neo4j'
  2. I cannot connect to http://localhost:7474
  3. I didn't modify neo4j.conf because I don't know how to do that.

I used my credential in the auth and the url provided in the environment variables. I have just a message 'ExperimentalWarning: The configuration may change in the future'. I still cannot connect to http://localhost:7474

pip install neo4j will only install the dependencies to your project.

You'll need an instance of Neo4j running somewhere. The course creates a Sandbox instance for you and the second lesson gives you the credentials you need. Or you can create another one at If you want to connect to a local instance you'll either need to download the binaries from or download Neo4j Desktop.