在使用pyswip(mac)时,我得到了一个错误libpl (shared) not found.
(请参阅下面的详细信息)。我知道几年前有一个关于它的问题,但它没有得到解决。我用自制软件安装了swiplog(>;7.0.0),并为pyswip运行2to3。帮助我。在
PS:我在学习逻辑编程,我需要它。在
libpl (shared) not found. Possible reasons: 1) SWI-Prolog not installed as a shared library. Install SWI-Prolog (5.6.34 works just fine) An exception has occurred, use %tb to see the full traceback.
错误在这里抛出。在
# UNIX-like
try:
_lib = CDLL("libpl.dylib")
except IndexError:
# let's try the cwd
_lib = CDLL("./libpl.so")
我终于找到了一个解决方案:pyswip不支持SWI-Prolog 8.x.x,唯一适合我的SWI-Prolog版本是自制的SWI-Prolog 7.6.4(最新的7.x.x稳定版本)。因为自制程序不能跟踪不同版本的swi-prolog,所以我不得不去挖掘旧的7.6.4“公式”。现在它可以与当前版本的pyswip(0.2.8)一起工作。在
TL;DR:删除当前的SWI-Prolog安装(并删除任何相关的路径编辑),然后执行
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/09a94009142a6265b0b8e322463100610aeda964/Formula/swi-prolog.rb
并结束它。在编辑:
注意:这种方法不允许您使用一些Prolog包,如
library(process)
和library(http/json)
。要更正此问题,您可以安装macOS应用程序,然后手动安装并重新链接libncurses.6.dylib
,以便PySwip能够找到它,如下所示:相关问题 更多 >
编程相关推荐