cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Verifying driver connectivity issue - Python Jupyter notebook

stephflint
Node Clone

Hi,

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
driver.verify_connectivity()

 

It returns the following error:

 

/var/folders/d7/q_fznsr95_97r6lp_mx_vp640000gn/T/ipykernel_98786/954338410.py:2: ExperimentalWarning: The configuration may change in the future.
  driver.verify_connectivity()
...
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')

 

2 REPLIES 2

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 sandbox.com.

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 sandbox.neo4j.com site.

 

Elaine

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).

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online