Does neo4j work with WSL2?

Hi everyone!

The problem: I get an errno 111: no connection between the python client and the activated neo4j graph db. Same situation with both py2neo and neo4j python driver

The setup: WSL2 (build 4.19.121.1) with Ubuntu 18.04 LTS, on windows 10 Pro insider preview (build 20152.rs_prelease.200617-1502)

On WSL2, a conda env was created with py2neo, rapidsai, etc. On windows, neo4j and pycharm are installed. The code is written in pycharm and as an interpreter I use the conda env from WSL2. However, every time I'm trying to run a query, I get an errno 111 error message. Queries from the neo4j interface run smoothly.

The code:

  1. graph = Graph("bolt://localhost:7687", auth=("user", "pass"), max_connection_lifetime=200)
  2. q1 = """ CALL apoc.periodic.iterate( "MATCH (n:Person) RETURN n", "DETACH DELETE n", {batchSize:1000})
    """
  3. output = graph.run(q1).to_data_frame()

The problem appears in line 3. What would cause this issue?

Neo4j desktop 1.2.9
DB version: 3.5.17 and 3.5.19 were tried

Thanks!
Andreas

Sounds like there is some sort of connectivity issue.

Do I understand it correctly if I think the database is running natively in Windows and your script in the WSL environment?

Not familiar with WSL at all but I would suspect that the localhost of WSL is a different one than the windows environment. Perhaps I am completely wrong though, haven't seen Windows from up close for over 15 years.

However that 111 error is a Python connection error, I would dig into that direction.