1

我正在尝试使用 Python 连接到 Neo4j,但在该行中出现与 Bolt 协议相关的错误

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

我使用驱动程序 neo4j-driver 4.0.2 运行代码。我也尝试过 neo4j-driver 4.1.1,我也遇到了同样的问题。

我错过了一些配置吗?

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)])
4

1 回答 1

0

尝试刷新 tox 缓存,如此neo4j 问题中所述。

于 2020-10-31T19:58:03.793 回答