pythonneo4jbolt

Connection problem related to Bolt Protocol and Neo4j using Python


I'm trying to connect to Neo4j using Python but I get an error related to Bolt Protocol in the line

driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "neo4j"))

I ran the code using the driver neo4j-driver 4.0.2. I've also tried neo4j-driver 4.1.1 and I've got the same problem.

Am I missing some configuration?

Traceback (most recent call last):
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\__init__.py", line 194, in bolt_driver
    return BoltDriver.open(target, auth=auth, **config)
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\__init__.py", line 357, in open
    pool = BoltPool.open(address, auth=auth, pool_config=pool_config, workspace_config=default_workspace_config)
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\io\__init__.py", line 510, in open
    seeds = [pool.acquire() for _ in range(pool_config.init_size)]
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\io\__init__.py", line 510, in <listcomp>
    seeds = [pool.acquire() for _ in range(pool_config.init_size)]
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\io\__init__.py", line 523, in acquire
    return self._acquire(self.address, timeout)
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\io\__init__.py", line 395, in _acquire
    connection = self.opener(address, timeout)
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\io\__init__.py", line 507, in opener
    return Bolt.open(addr, auth=auth, timeout=timeout, **pool_config)
  File "C:\Users\Anita Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\io\__init__.py", line 212, in open
    raise BoltHandshakeError("The Neo4J server does not support communication with this driver. This driver have support for Bolt Protocols {}".format(supported_versions), address=address, request_data=handshake, response_data=data)
neo4j._exceptions.BoltHandshakeError: The Neo4J server does not support communication with this driver. This driver have support for Bolt Protocols dict_keys([Version(3, 0), Version(4, 0)])

 The above exception was the direct cause of the following exception:
 
 Traceback (most recent call last):   File "src/load_db.py", line 11,
 in <module>
     driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "neo4j"))   File "C:\Users\Anita
 Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\__init__.py",
 line 181, in driver
    return cls.bolt_driver(parsed.netloc, auth=auth, **config)   File "C:\Users\Anita
 Caron\AppData\Local\Programs\Python\Python38\lib\site-packages\neo4j\__init__.py",
 line 197, in bolt_driver
     raise ServiceUnavailable(str(error)) from error neo4j.exceptions.ServiceUnavailable: The Neo4J server does not support
 communication with this driver. This driver have support for Bolt
Protocols dict_keys([Version(3, 0), Version(4, 0)])

Solution

  • Try refreshing the tox cache, as mentioned in this neo4j issue.