Showing results for 
Search instead for 
Did you mean: 

Verifying driver connectivity issue - Python Jupyter notebook

Node Clone


I'm going through the Building Neo4j Applications with Python course on GraphAcademy and am encountering a problem when trying to  connect and verify the driver instance:


# Create a new Driver instance
driver = GraphDatabase.driver("neo4j://localhost:7687",
    auth=("neo4j", "runaway-trades-presence"))


When I then try the command to verify the connection details like so:


# Verify the connection details


It returns the following error:


/var/folders/d7/q_fznsr95_97r6lp_mx_vp640000gn/T/ipykernel_98786/ ExperimentalWarning: The configuration may change in the future.
ServiceUnavailable: Could not connect to any routing servers.


The .env file has been updated with the correct credentials - any ideas why this is happening?

I'm also not able to print or view any of the following in Python - neo4j_uri, neo4j_username etc.


neo4j_uri = os.getenv('NEO4J_URI')
neo4j_username = os.getenv('NEO4J_USERNAME')
neo4j_password = os.getenv('NEO4J_PASSWORD')



Hello @stephflint ,

In the sandbox setup lesson, you should have set the environment variables to those for the sandbox, which is a URI that contains

Note that by default, a sandbox exists for 3 days, but can be extended to 10. If the sandbox originally created for the course expires, GraphAcademy will create a new one for you and the credentials will have changed so be wary of that. You can always check the credentials of your Recommendations sandbox at the site.



Node Clone

Thanks @elaine_rosenber ,

The sandbox is still valid for 9 days (after extending). However, I'm still not getting it to work. I've also tried using the session = driver.session("WRITE") operation on a different task (unrelated to the GraphAcademy course) which was returning the following error:

TypeError: session() takes 1 positional argument but 2 were given

I'm not sure if there is a compatibility issue with my version of Neo4j or Python (3.9).