话不多说,直接上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', '*******'))
不然就会这样
搞定!!!