通过使用如下文所示的新版Connection profiles指令

self.g = Graph('http://localhost:7474/', auth=("neo4j", "123456"))
解决ValueError: The following settings are not supported: {'http_port': 7474}问题
This commit is contained in:
AIR 2022-11-20 15:00:36 +08:00
parent 2034d87a42
commit 9071e78ef1

View File

@ -12,11 +12,12 @@ class MedicalGraph:
def __init__(self):
cur_dir = '/'.join(os.path.abspath(__file__).split('/')[:-1])
self.data_path = os.path.join(cur_dir, 'data/medical.json')
self.g = Graph(
host="127.0.0.1", # neo4j 搭载服务器的ip地址ifconfig可获取到
http_port=7474, # neo4j 服务器监听的端口号
user="lhy", # 数据库user name如果没有更改过应该是neo4j
password="lhy123")
# self.g = Graph(
# host="127.0.0.1", # neo4j 搭载服务器的ip地址ifconfig可获取到
# http_port=7474, # neo4j 服务器监听的端口号
# user="test", # 数据库user name如果没有更改过应该是neo4j
# password="test")
self.g = Graph('http://localhost:7474/', auth=("neo4j", "123456"))
'''读取文件'''
def read_nodes(self):