neo4j-python-pandas-py2neo-v3 icon indicating copy to clipboard operation
neo4j-python-pandas-py2neo-v3 copied to clipboard

该项目在Win10上部署时neo4j注意事项

Open LMY-nlp0701 opened this issue 4 years ago • 6 comments

先看运行成功效果图: 1

pycharm里的需要安装的包以及版本都在 requirements.txt ,但是在还需要我们在Windows10上部署neo4j,下面是安装以及启动服务的注意事项。

1.Windows10安装neo4j 参考链接 neo4j安装详细步骤 注:该博客讲解的非常详细,请仔细按照步骤进行。

2.启动neo4j服务 2

2.1在浏览器输入 http://localhost:7474/browser/ 3

2.2修改URL和设置用户名以及密码,与代码中的信息相符合 4

5

3.在pycharm里运行代码 运行 invoice_neo4j.py 注:修改一下该文件的 invoice_neo4j.py 的第2行,包位置问题。 6

LMY-nlp0701 avatar Aug 04 '20 08:08 LMY-nlp0701

great! man

Greenhorntc avatar Aug 04 '20 09:08 Greenhorntc

我按照上面的修改了,但是现在只能显示出节点,不能显示节点之间的关系,请问你知道这要怎么解决吗,非常感谢! image

renhuali avatar Dec 05 '20 13:12 renhuali

我按照上面的修改了,但是现在只能显示出节点,不能显示节点之间的关系,请问你知道这要怎么解决吗,非常感谢! image

请问你解决了吗?我也是同样的问题

bibiup123 avatar Apr 12 '21 04:04 bibiup123

py2neo v4 doesn't has 'find_one' function. In the place of find_one please change to NodeMatcher.

For example: self.graph.find_one(label=self.invoice_name, property_key='name', property_value=df_data['name'][m]) change to: from py2neo import Graph, NodeMatcher matcher = NodeMatcher(self.graph) matcher.match(self.invoice_name, name=df_data['name'][m]).first()

pickleHatter avatar May 02 '21 07:05 pickleHatter

py2neo v4 doesn't has 'find_one' function. In the place of find_one please change to NodeMatcher.

For example: self.graph.find_one(label=self.invoice_name, property_key='name', property_value=df_data['name'][m]) change to: from py2neo import Graph, NodeMatcher matcher = NodeMatcher(self.graph) matcher.match(self.invoice_name, name=df_data['name'][m]).first()

调整之后还是报错?怎么办Traceback (most recent call last): File "D:\python\lib\site-packages\py2neo\internal\connectors.py", line 372, in run raw_result = hydrator.hydrate_result(r.data.decode("utf-8")) File "D:\python\lib\site-packages\py2neo\internal\hydration_init_.py", line 433, in hydrate_result raise HydrationError(*data["errors"]) py2neo.internal.hydration.HydrationError: {'code': 'Neo.ClientError.Statement.SyntaxError', 'message': 'Invalid input '{': expected "+" or "-" (line 1, column 31 (offset: 30))\r\n"MATCH (_:发票名称) WHERE _.name = {1} RETURN _"\r\n ^'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\知识图谱\neo4j-python-pandas-py2neo-v3-master\invoice_neo4j.py", line 76, in create_data.create_relation(relation_extraction()) File "D:\知识图谱\neo4j-python-pandas-py2neo-v3-master\dataToNeo4jClass\DataToNeo4jClass.py", line 33, in create_relation rel = Relationship(matcher.match(self.invoice_name, name=df_data['name'][m]).first(), File "D:\python\lib\site-packages\py2neo\matching.py", line 94, in first return self.graph.evaluate(*self.query_and_parameters()) File "D:\python\lib\site-packages\py2neo\database.py", line 395, in evaluate return self.begin(autocommit=True).evaluate(cypher, parameters, **kwparameters) File "D:\python\lib\site-packages\py2neo\database.py", line 876, in evaluate return self.run(cypher, parameters, **kwparameters).evaluate(0) File "D:\python\lib\site-packages\py2neo\database.py", line 823, in run return Cursor(self.connector.run(statement=cypher, File "D:\python\lib\site-packages\py2neo\internal\connectors.py", line 377, in run raise GraphError.hydrate(e.args[0]) py2neo.database.ClientError: SyntaxError: Invalid input '{': expected "+" or "-" (line 1, column 31 (offset: 30)) "MATCH (:发票名称) WHERE _.name = {1} RETURN _"

liuxiaobei6667 avatar Aug 14 '22 08:08 liuxiaobei6667

先看运行成功效果图: 1

pycharm里的需要安装的包以及版本都在 requirements.txt ,但是在还需要我们在Windows10上部署neo4j,下面是安装以及启动服务的注意事项。

1.Windows10安装neo4j 参考链接 neo4j安装详细步骤 注:该博客讲解的非常详细,请仔细按照步骤进行。

2.启动neo4j服务 2

2.1在浏览器输入 http://localhost:7474/browser/ 3

2.2修改URL和设置用户名以及密码,与代码中的信息相符合 4

5

3.在pycharm里运行代码 运行 invoice_neo4j.py 注:修改一下该文件的 invoice_neo4j.py 的第2行,包位置问题。 6

您好,方便留个邮箱联系一下吗我这个程序连不上mysql数据库

Pony991215 avatar Apr 10 '23 08:04 Pony991215