logic-and-learning-lab/Popper

Problem running v2.0.0 (pyswip related)

Closed this issue · 3 comments

When running Popper v2.0.0 I got this error:

$ python3 popper.py examples/alleven

Traceback (most recent call last):
  File "popper.py", line 4, in <module>
    from popper.loop import learn_solution
  File "/home/hakank/inductive_programming/andrewcropper/popper/Popper/popper/loop.py", line 4, in <module>
    from . tester import Tester
  File "/home/hakank/inductive_programming/andrewcropper/popper/Popper/popper/tester.py", line 6, in <module>
    from pyswip import Prolog
  File "/usr/local/lib/python3.7/site-packages/pyswip/__init__.py", line 29, in <module>
    from pyswip.prolog import Prolog
  File "/usr/local/lib/python3.7/site-packages/pyswip/prolog.py", line 28, in <module>
    from pyswip.core import *
  File "/usr/local/lib/python3.7/site-packages/pyswip/core.py", line 849, in <module>
    PL_mark_string_buffers = _lib.PL_mark_string_buffers
  File "/usr/local/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__
    func = self.__getitem__(name)
  File "/usr/local/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libswipl.so.7.6: undefined symbol: PL_mark_string_buffers

Environment:

  • Popper v2.0.0 (commit 88a945d)
  • Linux Ubuntu 18.04
  • Python v3.7.6 (it's the same problem with v3.9.4)
  • pyswip: git master version (installed via )pip install git+https://github.com/yuce/pyswip@master#egg=pyswip). Note that the simple test program at https://github.com/yuce/pyswip works without any problems.
  • SWI-prolog v7.6.4. This is the version installed via apt (Note: I downgraded from the PPA stable version of SWI-Prolog which throws the errors mentioned in #28 )

Ah! The key is to use the stable PPA-version of SWI-Prolog. Now it works without any problem.

(I had the development PPA version installed before that that gave errors (as per #28), but then downgraded to the old 7,6,4 with the error reported above.)