# Connecting Python with Neo4j desktop

**URL:** <https://community.neo4j.com/t/connecting-python-with-neo4j-desktop/71413>\
**Category:** Graph Data Science / Graph Analytics\
**Tags:** browser, cypher\
**Created:** [November 13, 2024, 7:43am UTC](https://community.neo4j.com/t/connecting-python-with-neo4j-desktop/71413 "2024-11-13T07:43:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![somnath.deb](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/somnath.deb/32/32597_2.png) [@somnath.deb](https://community.neo4j.com/u/somnath.deb)\
**Post date:** [November 13, 2024, 7:43am UTC](https://community.neo4j.com/t/connecting-python-with-neo4j-desktop/71413/1 "2024-11-13T07:43:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [November 13, 2024, 6:45pm UTC](https://community.neo4j.com/t/connecting-python-with-neo4j-desktop/71413/2 "2024-11-13T18:45:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![somnath.deb](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/somnath.deb/32/32597_2.png) [@somnath.deb](https://community.neo4j.com/u/somnath.deb)\
**Post date:** [November 14, 2024, 6:20am UTC](https://community.neo4j.com/t/connecting-python-with-neo4j-desktop/71413/3 "2024-11-14T06:20:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![florentin\_dorre](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/florentin_dorre/32/18241_2.png) [@florentin\_dorre](https://community.neo4j.com/u/florentin_dorre)\
**Post date:** [November 21, 2024, 8:28am UTC](https://community.neo4j.com/t/connecting-python-with-neo4j-desktop/71413/4 "2024-11-21T08:28:17Z")

</div>

@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](https://realpython.com/installing-python/)
