在下面的500 internal server error页面中,我遇到了这样的错误。
File "/usr/local/lib/python3.5/dist-packages/pyDatalog/pyParser.py", line 388, in __call__
literal = Literal.make(self._pyD_name, tuple(args), kwargs)
File "/usr/local/lib/python3.5/dist-packages/pyDatalog/pyParser.py", line 510, in make
return precalculations & Query(predicate_name, terms, kwargs, prearity, aggregate)
File "/usr/local/lib/python3.5/dist-packages/pyDatalog/pyParser.py", line 574, in __init__
Literal.__init__(self, predicate_name, terms, kwargs, prearity, aggregate)
File "/usr/local/lib/python3.5/dist-packages/pyDatalog/pyParser.py", line 500, in __init__
self.lua = pyEngine.Literal(self.predicate_name, tbl, self.prearity, aggregate)
File "pyDatalog\pyEngine.py", line 402, in pyDatalog.pyEngine.Literal.__init__ (pyDatalog/pyEngine.c:15254)
File "pyDatalog\pyEngine.py", line 333, in pyDatalog.pyEngine.Pred.__new__ (pyDatalog/pyEngine.c:13917)
File "pyDatalog\pyEngine.py", line 334, in pyDatalog.pyEngine.Pred.__new__ (pyDatalog/pyEngine.c:13431)
AttributeError: '_thread._local' object has no attribute 'logic'如何访问PyDataLog变量
发布于 2018-12-07 08:50:39
我在这里一节中找到了答案Thread safety and multi-models。如果它能帮助其他人面对我所面对的一切。
Python程序可能启动几个线程。每个线程都应该有这些语句来初始化pyDatalog:
from pyDatalog import pyDatalog, Logic
Logic() # initializes the pyDatalog enginehttps://stackoverflow.com/questions/53664552
复制相似问题