Error al conectar python a neo4j usando py2neo

Escribí el siguiente código de Python a neo4j usando py2neo

from py2neo import Graph from py2neo import neo4j,Node,Relationship sgraph = Graph() alice = Node("person",name="alice") bob = Node("person",name="bob") alice_knows_bob = Relationship(alice,"KNOWS",bob) sgraph.create(alice_knows_bob) 

pero tengo el siguiente error

 Traceback (most recent call last): File "C:\Python34\lib\site-packages\py2neo\core.py", line 258, in get response = self.__base.get(headers=headers, redirect_limit=redirect_limit, * *kwargs) File "C:\Python34\lib\site-packages\py2neo\packages\httpstream\http.py",line 966, in get return self.__get_or_head("GET", if_modified_since, headers, redirect_limit, **kwargs) File "C:\Python34\lib\site-packages\py2neo\packages\httpstream\http.py",line 943, in __get_or_head return rq.submit(redirect_limit=redirect_limit, **kwargs) File "C:\Python34\lib\site-packages\py2neo\packages\httpstream\http.py",line 452, in submit return Response.wrap(http, uri, self, rs, **response_kwargs) File "C:\Python34\lib\site-packages\py2neo\packages\httpstream\http.py",line 489, in wrap raise inst py2neo.packages.httpstream.http.ClientError: 401 Unauthorized During handling of the above exception, another exception occurr ed: Traceback (most recent call last): File "neo.py", line 7, in  sgraph.create(alice_knows_bob) File "C:\Python34\lib\site-packages\py2neo\core.py", line 704, in create statement = CreateStatement(self) File "C:\Python34\lib\site-packages\py2neo\cypher\create.py", 44,in__init__ self.supports_node_labels = self.graph.supports_node_labels File "C:\Python34\lib\site-packages\py2neo\core.py", line 1078, in supports_node_labels return self.neo4j_version >= (2, 0) File "C:\Python34\lib\site-packages\py2neo\core.py", line 956, in neo4j_version return version_tuple(self.resource.metadata["neo4j_version"]) File "C:\Python34\lib\site-packages\py2neo\core.py", line 213, in metadata self.get() File "C:\Python34\lib\site-packages\py2neo\core.py", line 261, in get raise Unauthorized(self.uri.string) py2neo.error.Unauthorized: http://localhost:7474/db/data/ 

¿Alguien me puede ayudar? Esta es la primera vez que escribo un código de Python para conectarme a neo4j.

Si está utilizando Neo4j 2.2, la autenticación para servidores de bases de datos está habilitada de forma predeterminada. Debe autenticarse antes de realizar otras operaciones. Lea la documentación .

 from py2neo import authenticate, Graph # set up authentication parameters authenticate("localhost:7474", "user", "pass") # connect to authenticated graph database sgraph = Graph("http://localhost:7474/db/data/") # create alice and bob ... 

De la misma documentación ,

Py2neo proporciona una herramienta de línea de comandos para ayudar a cambiar las contraseñas de los usuarios y para verificar si se requiere un cambio de contraseña.

Para una nueva instalación, use:

 $ neoauth neo4j neo4j my-p4ssword Password change succeeded 

Después de establecer una contraseña, la herramienta también se puede utilizar para validar las credenciales

 $ neoauth neo4j my-p4ssword Password change not required