Lukas00990 2022-03-09 06:08 采纳率: 40.8%
浏览 1223
已结题

使用NEO4J 创建关系的时候报错AttributeError: 'NoneType' object has no attribute 'labels' #6

参考此数据集

在下面代码
https://github.com/jm199504/Financial-Knowledge-Graphs/blob/master/code/python_to_neo4j.ipynb

的这一步,报错。
matcher = NodeMatcher(graph)
for i in holder.values:
a = matcher.match("股票",TS代码=i[0]).first()
b = matcher.match("股东",TS代码=i[0])
for j in b:
r = Relationship(j,'参股',a)
graph.create(r)
print('TS',str(i[0]))

报以下错误
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 847, in init
Entity.init(self, (n[0], self, n[1]), properties)
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 553, in init
Walkable.init(self, iterable)
File "E:\Anaconda3\lib\site-packages\py2neo\data.py", line 453, in init
_ = node.labels # ensure not stale
AttributeError: 'NoneType' object has no attribute 'labels'

Process finished with exit code 1

是哪儿设置错误了吗?

  • 写回答

7条回答 默认 最新

  • Lukas00990 2022-03-10 03:15
    关注

    有专家吗

    评论

报告相同问题?

问题事件

  • 系统已结题 3月17日
  • 赞助了问题酬金10元 3月10日
  • 创建了问题 3月9日

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试