Connecting Python with Neo4j desktop

Hi all, I am trying to connect my python env from google Collab with my neo4j desktop 5.24v,
I am trying with below script
from graphdatascience import GraphDataScience

gds = GraphDataScience('neo4j://localhost:7687', auth=('neo4j', '****'))

but its erroring out with
ERROR:neo4j.pool:Unable to retrieve routing information
WARNING:root:Unable to connect to the Neo4j DBMS. Trying again...
ERROR:neo4j.pool:Unable to retrieve routing information
ERROR:neo4j.pool:Unable to retrieve routing information
ERROR:neo4j.pool:Unable to retrieve routing information

any idea how to fix it?

Google collab runs within google's infrastructure. It will not see neo4j://localhost as your neo4j desktop instance. You would have to use the external IP address of your router at home, and then port forward it to your IP address of your PC.

Then may i know what is the best way to connect neo4j from python environment rather using google collab?

@somnath.deb I would suggest run the python code on your local computer.
You could f.i. follow How to Install Python on Your System: A Guide – Real Python