liuhuanyong / QASystemOnMedicalKG

A tutorial and implement of disease centered Medical knowledge graph and qa system based on it。知识图谱构建,自动问答,基于kg的自动问答。以疾病为中心的一定规模医药领域知识图谱,并以该知识图谱完成自动问答与分析服务。
6.18k stars 2.13k forks source link

导入数据不成功 #20

Open violahuyoujin opened 5 years ago

violahuyoujin commented 5 years ago

网页端打开neo4j后,在pycharm中运行build_medicalgraph.py,没能导入数据,请问大家都是怎么导入的? 我把data文件夹放在项目的venv下面了,会不会是我的项目目录有问题,找不到对应的json文件?

violahuyoujin commented 5 years ago

【补充】:我在最后面写了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 handler.create_graphnodes(); File "E:/python_pycharm/QA_MedicalKG/build_medicalgraph.py", line 187, in create_graphnodes self.create_diseases_nodes(disease_infos) File "E:/python_pycharm/QA_MedicalKG/build_medicalgraph.py", line 179, in create_diseases_nodes self.g.create(node) File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\py2neo\database.py", line 355, in create with self.begin() as tx: File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\py2neo\database.py", line 346, in begin return Transaction(self, autocommit) File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\py2neo\database.py", line 758, in init self.transaction = self.connector.begin() File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\py2neo\internal\connectors.py", line 290, in begin tx = self.pool.acquire() File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\neobolt\direct.py", line 704, in acquire return self.acquire_direct(self.address) File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\neobolt\direct.py", line 597, in acquire_direct connection = self.connector(address, error_handler=self.connection_error_handler) File "E:\python_pycharm\QAMedicalKG\venv\lib\site-packages\py2neo\internal\connectors.py", line 225, in connector return connect(address, auth=cx_data["auth"], **kwargs) File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\neobolt\direct.py", line 947, in connect resolver.dns_resolve() File "E:\python_pycharm\QA_MedicalKG\venv\lib\site-packages\neobolt\addressing.py", line 134, in dns_resolve raise AddressError("Cannot resolve address {!r}".format(address)) neobolt.addressing.AddressError: Cannot resolve address ('http', 7687) Process finished with exit code 1 还未找到解决办法,求助!

Gangstart commented 5 years ago

https://blog.csdn.net/weixin_36105362/article/details/88584313#commentsedit

violahuyoujin commented 5 years ago

感谢楼上,已解决问题,host地址写错了,我没修改neo4j的conf文件配置,所以默认host应该是127.0.0.1,成功导入数据

18813055625 commented 5 years ago

请问怎么修改?

18813055625 commented 5 years ago

@violahuyoujin 请问一下,怎么修改host?

yan624 commented 5 years ago

@violahuyoujin 请问一下,怎么修改host?

host 就是本地的地址啊,127.0.0.1

chenbaicheng commented 5 years ago

@yan624 不知道是谁这样坑人的 竟然将代码修改了 少了你说的那两句代码 数据根本不会写入neo4j

Ke51n commented 2 years ago

请问运行到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

Gangstart commented 1 year ago

您的邮件已收到 谢谢!

hysaint commented 1 year ago

请问运行到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

一样的错误,求解答

Gangstart commented 1 year ago

您的邮件已收到 谢谢!

juneyu commented 1 year ago

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'))

Gangstart commented 1 year ago

您的邮件已收到 谢谢!