yuce / pyswip

PySwip is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface.
MIT License
464 stars 97 forks source link

Could not find the SWI-Prolog library in this platform. #148

Open jiacheng-ye opened 1 year ago

jiacheng-ye commented 1 year ago

I've installed swipl with snap refering https://www.swi-prolog.org/build/snap.html.

But when I import pyswip in python, it raises Could not find the SWI-Prolog library in this platform. If you are sure it is installed, please open an issue..

Also, I found after I run swipl --dump-runtime-variables, it shows:

PLBASE="/snap/swi-prolog/68/usr/lib/swipl";
PLARCH="x86_64-linux";
PLBITS="64";
PLVERSION="90003";
PLSOEXT="so";
PLSOPATH="LD_LIBRARY_PATH";
PLLIBDIR="/snap/swi-prolog/68/usr/lib/swipl/lib/x86_64-linux";
PLLIB="-lswipl";
PLLIBSWIPL="/snap/swi-prolog/68/usr/lib/libswipl.so.9";
PLSHARED="yes";
PLTHREADS="yes";

But I do not find libswipl.so:

image

Any helps and thanks in advance.

jiacheng-ye commented 1 year ago

Btw, this is the system info:

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
VorpalBlade commented 1 year ago

What is the version of swipl? PySwip is currently incompatible with SWI-Prolog 9.x.

LyzardKing commented 9 months ago

If somebody else has this issue, it works if you install from the git repo (the version on pypi is not updated)