[Py2neo] AuthError when accessing graph from Python

Hi! I'm a newbie to Neo4j and I got problems when trying to connect to the neo4j browser using Python.

I just tried out some simple codes that can be found in most of the Py2neo tutorials out there: (in jupyter notebook)

from py2neo import Graph
from neo4j import GraphDatabase
g = Graph(uri="bolt://localhost:7687", auth=("neo4j", "neo4j"))

Object g:

<Graph database=<Database uri='bolt://localhost:7687' secure=False user_agent='py2neo/4.3.0 neobolt/1.7.13 Python/3.7.1-final-0 (darwin)'> name='data'>

However, when I tried to do some actual work like

tx = graph.begin()

I got the error:

AuthError: The client is unauthorized due to authentication failure.

more details:

~/anaconda3/lib/python3.7/site-packages/neobolt/direct.py in on_failure(self, metadata)
    776         message = metadata.get("message", "Connection initialisation failed")
    777         if code == "Neo.ClientError.Security.Unauthorized":
--> 778             raise AuthError(message)
    779         else:
    780             raise ServiceUnavailable(message)type or paste code here

I'm using Neo4j community 3.5.7 (I've installed Neo4j Desktop before but I deleted). Can anyone help me out? Thanks!

-- Tianyi

First access to a started database uses the credentials neo4j/neo4j, but you must change the password for the neo4j user. Did you change the password?

Elaine

1 Like

Thank you very much Elaine. It worked! :blush:

-- Tianyi

I have the same problem

Py2neo has reached end of life. Consider switching to Neomodel documentation — neomodel 5.3.0 documentation.

You may want to start first making sure connectivity works with the official Python driver. This covers all the basic functionality already.

1 Like