1

I am getting error like this below in the 500 internal server error page.

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'

How can access the PyDataLog variables

Enkum
  • 635
  • 8
  • 22
  • Possible duplicate of ['thread.\_local' object has no attribute](https://stackoverflow.com/questions/20640679/thread-local-object-has-no-attribute) – Sarima Dec 07 '18 at 06:47
  • @Joshpbarron not duplicate. This is related to Cherrypy and PyDataLog. I have already seen what you mentioned and found it not helpful. So please remove the flag. – Enkum Dec 07 '18 at 06:50

1 Answers1

0

I have found the answer here in the Thread safety and multi-models section. If it can help anyone else facing what I faced.

A Python program may start several threads. Each thread should have these statements to initialize pyDatalog :

from pyDatalog import pyDatalog, Logic
Logic() # initializes the pyDatalog engine
Enkum
  • 635
  • 8
  • 22