PySWIP requires SWI-Prolog as a shared library since it uses ctypes to access SWI-Prolog/C functions. The shared library is present in the Win32 installer, but missing by default from the builds made directly from the source.
These instructions are tested on a Linux system, but should also work for POSIX systems. Also, you may want to install development packages for readline, libncurses, and libgmp.
You need to do the following to install a shared library enabled version of SWI-Prolog. We use version 6.0.2 of SWI-Prolog. Please make the necessary modifications for your environment.
*** If using a 64-bit system, you may have to compile with the -ggdb flag in order to get PySWIP to work with SWI-Prolog without segfaults (But not necessarily. YMMV.):
If you get an error, such as "libpl (shared) not found." or "FATAL ERROR: Resource not found" be sure you have installed SWI-Prolog as a shared library. Check your default library directory (usually ``/usr/lib``) for ``libswipl.so``.
1) Get a recent version of SWI-Prolog for Win32 from: http://www.swi-prolog.org/dl-stable.html and install it.
2) You need to add SWI-Prolog's bin directory ``C:\Program Files\pl\bin`` to *path*, here are two tutorials for that: http://www.computerhope.com/issues/ch000549.htm and http://vlaurie.com/computers2/Articles/environment.htm
3) Get a Windows installer version of PySWIP and install it.
4) After you install it, you can test it with the following at your Python console::