py2neo由于身份验证失败,客户端未经授权

2024-04-20 13:51:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我曾尝试从python 3连接到neo4j,但总是遇到这样的错误:

---------------------------------------------------------------------------
AuthError                                 Traceback (most recent call last)
<ipython-input-20-e407bdc814a1> in <module>
----> 1 graph.create(cloves)

~/.local/lib/python3.6/site-packages/py2neo/database.py in create(self, subgraph)
    353                        :class:`.Subgraph`
    354         """
--> 355         with self.begin() as tx:
    356             tx.create(subgraph)
    357

~/.local/lib/python3.6/site-packages/neobolt/direct.py in on_failure(self, metadata)
    755         message = metadata.get("message", "Connection initialisation failed")
    756         if code == "Neo.ClientError.Security.Unauthorized":
--> 757             raise AuthError(message)
    758         else:
    759             raise ServiceUnavailable(message)

AuthError: The client is unauthorized due to authentication failure.

我的代码是:

^{pr2}$

我检查了默认情况下在neo4j上注册的用户。在

print screen from my neo4j browser

我尝试过一些方法,比如创建一个架构师角色。即使如此,当我声明用户时,也会得到相同的错误。在


Tags: inpyselfmessagefailurelibpackageslocal