QASystemOnMedicalKG
QASystemOnMedicalKG copied to clipboard
导入数据不成功
网页端打开neo4j后,在pycharm中运行build_medicalgraph.py,没能导入数据,请问大家都是怎么导入的? 我把data文件夹放在项目的venv下面了,会不会是我的项目目录有问题,找不到对应的json文件?
【补充】:我在最后面写了handler.create_graphnodes(); handler.create_graphrels() 但是在pycharm中从1走到8808后,程序报错: Traceback (most recent call last): File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\neobolt\addressing.py", line 132, in dns_resolve info = getaddrinfo(address[0], address[1], 0, SOCK_STREAM, IPPROTO_TCP) File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:/python_pycharm/QA_MedicalKG/build_medicalgraph.py", line 273, in
https://blog.csdn.net/weixin_36105362/article/details/88584313#commentsedit
感谢楼上,已解决问题,host地址写错了,我没修改neo4j的conf文件配置,所以默认host应该是127.0.0.1,成功导入数据
请问怎么修改?
@violahuyoujin 请问一下,怎么修改host?
@violahuyoujin 请问一下,怎么修改host?
host 就是本地的地址啊,127.0.0.1
@yan624 不知道是谁这样坑人的 竟然将代码修改了 少了你说的那两句代码 数据根本不会写入neo4j
请问运行到8808报这样的错怎么改啊
Traceback (most recent call last):
File "E:/12.论文代码/QASystemOnMedicalKG-master/build_medicalgraph.py", line 271, in
Process finished with exit code 1
您的邮件已收到 谢谢!
请问运行到8808报这样的错怎么改啊 Traceback (most recent call last): File "E:/12.论文代码/QASystemOnMedicalKG-master/build_medicalgraph.py", line 271, in handler.create_graphnodes() File "E:/12.论文代码/QASystemOnMedicalKG-master/build_medicalgraph.py", line 185, in create_graphnodes self.create_diseases_nodes(disease_infos) File "E:/12.论文代码/QASystemOnMedicalKG-master/build_medicalgraph.py", line 177, in create_diseases_nodes self.g.create(node) File "F:\anaconda\envs\KBQA\lib\site-packages\py2neo\graph.py", line 389, in create with self.begin() as tx: File "F:\anaconda\envs\KBQA\lib\site-packages\py2neo\graph.py", line 380, in begin return Transaction(self, autocommit) File "F:\anaconda\envs\KBQA\lib\site-packages\py2neo\graph.py", line 804, in init self.session = driver.session() File "F:\anaconda\envs\KBQA\lib\site-packages\neo4j\v1\bolt.py", line 51, in session return BoltSession(self.pool.acquire(self.address)) File "F:\anaconda\envs\KBQA\lib\site-packages\neo4j\bolt\connection.py", line 460, in acquire connection.pool = self AttributeError: 'NoneType' object has no attribute 'pool'
Process finished with exit code 1
一样的错误,求解答
您的邮件已收到 谢谢!
1、If you are the latest version of neo4j, you also need the latest version of py2neo.
Python3- m pip install py2neo -- upgrade
2、Modify the database connection method to a new one.
Graph=Graph ('bolt://localhost:7687', auth=('neo4j','lhy123'))
您的邮件已收到 谢谢!