Neo4j 使用教程Python!!!一篇搞定所有bug。

话不多说,直接上bug解决方案!!!

Bug1 版本问题

D:\anaconda\envs\Pytorch-GPU\python.exe D:\PycharmProjects\知识图谱\dataset.py 
Traceback (most recent call last):
  File "D:\PycharmProjects\知识图谱\dataset.py", line 5, in <module>
    graph = Graph("neo4j://localhost:7687", username="neo4j", password='CHEN1569qaz')
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\py2neo\database.py", line 288, in __init__
    self.service = GraphService(profile, **settings)
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\py2neo\database.py", line 115, in __init__
    profile = ServiceProfile(profile, **settings)
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\py2neo\__init__.py", line 475, in __init__
    super(ServiceProfile, self).__init__(profile, **settings)
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\py2neo\__init__.py", line 190, in __init__
    self._apply_settings(**settings)
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\py2neo\__init__.py", line 510, in _apply_settings
    return super(ServiceProfile, self)._apply_settings(uri, scheme, protocol, secure, verify,
  File "C:\Users\Admin\AppData\Roaming\Python\Python39\site-packages\py2neo\__init__.py", line 293, in _apply_settings
    raise ValueError("The following settings are not supported: %r" % other)
ValueError: The following settings are not supported: {'username': 'neo4j'}

Process finished with exit code 1

重装?!那是不可能的

第一种:低版本

graph = Graph('http://localhost:7474', username="neo4j", password="*******")

第二种:高版本

graph = Graph("http://localhost:7474", auth=("neo4j", "*******"))

Bug2 网站问题

大家在链接数据库的时候,首先得在http://localhost:7474/这个网站连接GUL!!!
在这里插入图片描述
然后复制这个
在这里插入图片描述
粘贴到这里就没问题了

graph = Graph("neo4j://localhost:7687", auth=('neo4j', '*******'))

不然就会这样
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/b1489c653dc64dd6953507b159df20a3.png
搞定!!!

  • 6
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值