Python driver connection not working

Hi, im using neo4j desktop, and create a local DB. I can connect to it fine using http://localhost:7474/browser/ , however when I try to connect to it using the python driver, I get a connection error. It's very strange since the credentials are the same. Any help would be greatly appreciated!

Hi @jonathanakar664
What uri are you using to connect to with the driver? it should be bolt://localhost:7687

1 Like

yes, thats what im using. This article: How to resolve Python Bolt Driver when executed gives an error "("Failed to establish connection to {!r}".format(address))" - Knowledge Base basically described my issue. I tried both solutions it recommends and neither worked sadly. Been stuck at this for a few hours now :/

here is the exact error i get: 'ServiceUnavailable: Couldn't connect to localhost:7687 (resolved to ()):
Failed to establish connection to ResolvedIPv4Address(('127.0.0.1', 7687)) (reason [Errno 111] Connection refused)'

Can you please enable debug logging in the driver (see API docs on how to do that) and share the debug logs here? Maybe there's a hint in there what exactly is going wrong.

1 Like

I think i may know what the issue is, im running the python code from google collab, so could that affect its ability to connect locally?

That's exactly the issue then, yes. Your Python code will run on one of Google's servers and has no way to establish a network connection to your local machine. I remember there used to be a similar problem in the forums. I'll search and let you know if I find it again.

1 Like

Let me correct that, it was in the issues on the driver's repository on GitHub. See this comment for possible solutions.

1 Like

All good, I think im just gonna have to make a python app instead and use jupyter notebook on the backend. Thanks and glad thats over with! Lol

Also: thanks for the quick responses I really appreciate it!

1 Like