想跑一下这个demo
https://github.com/Skyellbin/neo4j-python-pandas-py2neo-v3
首先需要在win10里装一下neo4j,主要参考下面两个帖子
demo的github教程
neo4j安装
按照帖子安装的时候出现了一个错误
'neo4j.bat'不是内部或外部命令,也不是可运行的程序
但实际上我的环境变量已经按照教程配置好了,不知道为什么检索不到
百度到了一样的问题,建议直接在neo4j.bat所在的文件夹执行neo4j.bat console
参考博客
果然在文件夹内部执行就可以,迷惑
之后按照github里面的指示把之后的配置好
https://github.com/Skyellbin/neo4j-python-pandas-py2neo-v3/issues/8
在连接时出现了两个问题,都按照neo4j安装里面配置好即可
问题1(帖子里的坑1)
ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket readyState is: 3
点击防火墙-》高级设置–》--入站–》新建–》端口7474–》下一步–》允许连接–》下一步–》名称dbms.connector.http–》完成
问题2
修改好问题1后再次登录出现
Neo.ClientError.Security.Unauthorized: The client is unauthorized due to authentication failure.
按照帖子修改neo4j.conf配置
取消该行注释保存即可
dbms.security.auth_enabled=false
完成后,顺利登陆
然后按照github中的requirement.txt安装需要的库文件
这里需要注意一点
txt中要求py2neo==3,如果py2neo版本高,会出现错误:'Graph' object has no attribute 'find_one'
必须要py2neov3及以下版本可以跑通此代码,但是现在py2neo只支持v4版本及以上了,因此我们要自行下载py2neo
下载地址
https://webscripts.softpedia.com/script/Database-Tools/py2neo-71471.html
py2neo的云盘,大家如果没法FQ可以自行取用
链接:https://pan.baidu.com/s/1UP3DjZas7eSfXCN5l99O-A
提取码:mjnu
在运行代码的时候需要修改两个地方
1.
这里要修改成自己的路径
2.这里修改成自己的neo4j地址
成功运行