Py2neo 返回的 IndexError 是什么?

问题描述

当我使用 Py2neo 运行密码查询时,我收到以下错误消息。我真的不明白这是什么意思。我猜由于某些原因,与数据库的连接已关闭或中断。你能帮我理解这条消息吗? 需要明确的是,这是我的代码的一部分。 neo4jDB一个图形对象。 cypher_query 是一串密码。 neo4jDB.run(cypher_query).data() 返回字典列表。

cypher_query 看起来像这样 'MATCH (n:node) <-[:relationship]-(another:another node) WHERE n.id='12345' AND another.id='12345' RETURN another.x,another.y,another.z,another.w limit 1'

我的代码的一部分

if len(neo4jDB.run(cypher_query).data()) == 0:
        no_records.append(id)

错误信息

IndexError                                Traceback (most recent call last)
~\anaconda3\lib\site-packages\py2neo\client\__init__.py in acquire(self,force_reset,can_overfill)
    791                 # Plan A: select a free connection from the pool
--> 792                 cx = self._free_list.popleft()
    793             except IndexError:

IndexError: pop from an empty deque

During handling of the above exception,another exception occurred:

NotImplementedError                       Traceback (most recent call last)
<ipython-input-439-a052dd2ba35c> in <module>
----> 7     if len(neo4jDB.run(cypher_query).data()) == 0:
      8         no_records.append(id)

~\anaconda3\lib\site-packages\py2neo\database.py in run(self,cypher,parameters,**kwparameters)
    403         :return:
    404         """
--> 405         return self.auto().run(cypher,**kwparameters)
    406 
    407     def evaluate(self,parameters=None,**kwparameters):

~\anaconda3\lib\site-packages\py2neo\database.py in run(self,**kwparameters)
    976                 result = self._connector.run(self.ref,parameters)
    977             else:
--> 978                 result = self._connector.auto_run(cypher,979                                                   graph_name=self.graph.name,980                                                   readonly=self.readonly)

~\anaconda3\lib\site-packages\py2neo\client\__init__.py in auto_run(self,pull,graph_name,readonly)
   1336             cx = self._acquire_ro(graph_name)
   1337         else:
-> 1338             cx = self._acquire_rw(graph_name)
   1339         try:
   1340             result = cx.auto_run(cypher,graph_name=graph_name,readonly=readonly)

~\anaconda3\lib\site-packages\py2neo\client\__init__.py in _acquire_rw(self,graph_name)
   1238                 log.debug("Using connection pool %r",pool)
   1239                 try:
-> 1240                     cx = pool.acquire()
   1241                 except (ConnectionUnavailable,Connectionbroken):
   1242                     self.prune(pool.profile)

~\anaconda3\lib\site-packages\py2neo\client\__init__.py in acquire(self,can_overfill)
    797                     # ConnectionUnavailable exception,which
    798                     # should bubble up to the caller.
--> 799                     cx = self.connect()
    800                     if cx.supports_multi():
    801                         self._supports_multi = True

~\anaconda3\lib\site-packages\py2neo\client\__init__.py in connect(self)
    743             cx = self._opened_list.popleft()
    744             if cx.closed or cx.broken:
--> 745                 self._bytes_sent += cx.bytes_sent
    746                 self._bytes_received += cx.bytes_received
    747             else:

~\anaconda3\lib\site-packages\py2neo\client\__init__.py in bytes_sent(self)
    209     @property
    210     def bytes_sent(self):
--> 211         raise NotImplementedError
    212 
    213     @property

NotImplementedError: 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)