prolog need to work with Python 7.2.2 by pyswip

403 views
Skip to first unread message

sasuke uchiha

unread,
Aug 21, 2015, 7:38:46 PM8/21/15
to SWI-Prolog
7.2.2 prolog want to work with python 2.7 and I installed the library pyswip but when importing the package python tells me the following problem:

libpl (shared) not found. Possible Reasons:
1) SWI-Prolog not installed as a shared library. Install SWI-Prolog (6.5.34 works just fine)
look in the documentation but can not find the file libpl if someone could help me with this I would appreciate it have searched and can not find enough certainly use ubuntu 12.04 and install it via PPA

sasuke uchiha

unread,
Aug 22, 2015, 7:41:05 PM8/22/15
to SWI-Prolog

fucking google translator

which is the name of the libpl library in version 7 no longer has that name
 

Douglas Miles

unread,
Aug 22, 2015, 11:18:22 PM8/22/15
to SWI-Prolog
I have myself ported software that underwent that change.. like there might be more than changne libpl to libswipl but is a good place to start

sasuke uchiha

unread,
Aug 23, 2015, 6:14:44 PM8/23/15
to SWI-Prolog
so is not called. but in where you think that it could find, I use linux and install swi prolog via ppa repository.

but I'm desperate I can not find it

Stephen Coda

unread,
Aug 24, 2015, 4:51:53 AM8/24/15
to SWI-Prolog
I'd consider running swi-prolog as a server at this point to avoid the library madness and use the http libraries to make calls to it.
But I understand you might have specific reasons that mean you don't want to do it this way.

Jan Wielemaker

unread,
Aug 24, 2015, 5:40:42 AM8/24/15
to Stephen Coda, SWI-Prolog
On 08/24/2015 10:51 AM, Stephen Coda wrote:
> I'd consider running swi-prolog as a server at this point to avoid the
> library madness and use the http libraries to make calls to it.

Good point. I think it would be a good idea to implement the Pengine
client for other languages. The JavaScript version is available as
library/http/web/js/pengines.js in the distribution.

> But I understand you might have specific reasons that mean you don't
> want to do it this way.

The main reason not to go for the network based solution is the
relatively high latency that comes with the network. Often you can
reduce the impact by sending relatively big jobs to the Prolog server.

Cheers --- Jan

> On Sunday, 23 August 2015 23:14:44 UTC+1, sasuke uchiha wrote:
>
> sois notcalled.butinwhereyou thinkthatitcouldfind,I
> uselinuxandinstallswiprologviapparepository.
>
> butI'mdesperateIcannotfindit
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

Stephen Coda

unread,
Aug 24, 2015, 6:25:20 AM8/24/15
to SWI-Prolog, steph...@googlemail.com
I wondered about the latency issues myself, is it still significant when dealing with localhost?


On Monday, 24 August 2015 10:40:42 UTC+1, Jan Wielemaker wrote:
On 08/24/2015 10:51 AM, Stephen Coda wrote:
> I'd consider running swi-prolog as a server at this point to avoid the
> library madness and use the http libraries to make calls to it.

Good point. I think it would be a good idea to implement the Pengine
client for other languages. The JavaScript version is available as
library/http/web/js/pengines.js in the distribution.

> But I understand you might have specific reasons that mean you don't
> want to do it this way.

The main reason not to go for the network based solution is the
relatively high latency that comes with the network. Often you can
reduce the impact by sending relatively big jobs to the Prolog server.

        Cheers --- Jan

> On Sunday, 23 August 2015 23:14:44 UTC+1, sasuke uchiha wrote:
>
>     sois notcalled.butinwhereyou thinkthatitcouldfind,I
>     uselinuxandinstallswiprologviapparepository.
>
>     butI'mdesperateIcannotfindit
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com

Jan Wielemaker

unread,
Aug 24, 2015, 7:01:02 AM8/24/15
to Stephen Coda, SWI-Prolog
On 08/24/2015 12:25 PM, Stephen Coda wrote:
> I wondered about the latency issues myself, is it still significant when
> dealing with localhost?

It depends a lot on OS and hardware. Generally speaking you need
to think in the low millisecond region, while using the C API you
are in the low microsecond region. For many applications that is
totally irrelevant, for others it is a clear show stopper.

Cheers --- Jan

> On Monday, 24 August 2015 10:40:42 UTC+1, Jan Wielemaker wrote:
>
> On 08/24/2015 10:51 AM, Stephen Coda wrote:
> > I'd consider running swi-prolog as a server at this point to
> avoid the
> > library madness and use the http libraries to make calls to it.
>
> Good point. I think it would be a good idea to implement the Pengine
> client for other languages. The JavaScript version is available as
> library/http/web/js/pengines.js in the distribution.
>
> > But I understand you might have specific reasons that mean you don't
> > want to do it this way.
>
> The main reason not to go for the network based solution is the
> relatively high latency that comes with the network. Often you can
> reduce the impact by sending relatively big jobs to the Prolog server.
>
> Cheers --- Jan
>
> > On Sunday, 23 August 2015 23:14:44 UTC+1, sasuke uchiha wrote:
> >
> > sois notcalled.butinwhereyou thinkthatitcouldfind,I
> > uselinuxandinstallswiprologviapparepository.
> >
> > butI'mdesperateIcannotfindit
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "SWI-Prolog" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to swi-prolog+...@googlegroups.com <javascript:>
> > <mailto:swi-prolog+...@googlegroups.com <javascript:>>.
> <http://groups.google.com/group/swi-prolog>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.

sasuke uchiha

unread,
Aug 26, 2015, 12:45:32 AM8/26/15
to swi-p...@googlegroups.com



Stephen Coda
it is true, had not considered well 
the module http to connect with Node.js, Django, Ruby on Rails and other web technologies right?

Stephen Coda

unread,
Aug 26, 2015, 4:21:50 AM8/26/15
to SWI-Prolog
Yes, pretty much anything that can make http calls can talk to it. For example, you could send post requests in jquery via ajax and use json as a data exchange format. Thanks to swi-prolog's dictionaries, things like this are very straightforward and flexible.

sasuke uchiha

unread,
Aug 28, 2015, 1:26:21 AM8/28/15
to SWI-Prolog
well , then I will do so with websocket thank you very much for all your answers

Thomas McNeill

unread,
Sep 15, 2015, 3:12:39 PM9/15/15
to SWI-Prolog
I am having the same problem as Sasuke Uchida.  But in my case, we are doing this as an install on the Amazon cloud and need Prolog to communicate through pyswip.   Running through a socket won't be effective for our application. Can someone please tell me the right way to resolve this issue?  I have seen a variety of web posts that refer to older versions of Prolog (v5x.x) and required a name change of a .dll file.  With version 7.2.2, these files do not exist.  Help!

thanks,

tom. 

Stephen Coda

unread,
Sep 16, 2015, 11:02:51 AM9/16/15
to SWI-Prolog
"Running through a socket won't be effective for our application"

If you're worried about python talking to a swipl server on the same virtual machine, it should work through localhost. Or is there some other problem? I don't know what your situation is of course, but if it were me I'd want to avoid a lot of version wrangling.

Steve

Jan Wielemaker

unread,
Sep 16, 2015, 11:18:38 AM9/16/15
to Stephen Coda, SWI-Prolog
On 09/16/2015 05:02 PM, Stephen Coda wrote:
> libpl (shared) not found. Possible Reasons:
> 1) SWI-Prolog not installed as a shared library. Install SWI-Prolog
> (6.5.34 works just fine)
> look in the documentation but can not find the file libpl if someone
> could help me with this I would appreciate it have searched and can not
> find enough certainly use ubuntu 12.04 and install it via PPA

libpl.so has been renamed long time ago to libswipl.so for consistency
with the executable naming and to make the naming consistent across
OSes.

Cheers --- Jan

Thomas McNeill

unread,
Sep 16, 2015, 11:32:35 AM9/16/15
to SWI-Prolog
We want to avoid the socket solution because we are using our Prolog component as kind of a mini expert system/classifier.  It will be accessed repeatedly over a run.  Could we do this in SQL?   Sure we could, but Prolog offers some very interesting and useful benefits as we scale, such as the ability to easily spawn logical components and the fact that the over all footprint with Prolog is much smaller than that of SQL (so far).  Additionally, as our classifications get more complex, the code requirements to write what we want in Prolog is much simpler and faster than the equivalent SQL (no nasty inner/outer joins).  This will allow non-programming biologists to generate classification models with a short(er) learning curve.  And the final reason why we chose Prolog, SWI-Prolog in particular is the community.  This is an impressive community with smart people who are doing work in areas that are of particular interest to us.  As time progresses, we may even be posting opportunities for consulting engagements with our company.  Is there an appropriate place to post such offerings?

thanks,

tom.

On Friday, August 21, 2015 at 6:38:46 PM UTC-5, sasuke uchiha wrote:

Thomas McNeill

unread,
Sep 16, 2015, 11:48:42 AM9/16/15
to SWI-Prolog, steph...@googlemail.com
Thanks Jan!

You know, this might be one of those methodologies that ought to be written up and pinned somewhere in the community.  Kind of a how to connect SWI-Prolog to a variety of other languages, Python, Ruby, Java, Scala, etc.  I'm sure there are a lot  development teams out there that would find some of SWI-Prolog's elements very useful for parts of their projects.

tom.

Jan Wielemaker

unread,
Sep 17, 2015, 6:08:45 AM9/17/15
to Thomas McNeill, SWI-Prolog, steph...@googlemail.com
On 09/16/2015 05:48 PM, Thomas McNeill wrote:
> Thanks Jan!
>
> You know, this might be one of those methodologies that ought to be
> written up and pinned somewhere in the community. Kind of a how to
> connect SWI-Prolog to a variety of other languages, Python, Ruby, Java,
> Scala, etc. I'm sure there are a lot development teams out there that
> would find some of SWI-Prolog's elements very useful for parts of their
> projects.

Sure. The Java interface is bundled. That still gives a lot of
problems. It basically boils down to `dll hell', which a somewhat
less serious version hell. Every platform and every distribution
has its own tricks to find the relevant resources, which makes it
really hard to distribute these interfaces in a robust manner.

The next issue is that all these languages (including Prolog) tend
to take control of the entire environment and put restrictions on
threading, signal handling, garbage collection, etc. If something
goes wrong, it is often really hard to debug.

In other words, it takes a lot of dedication to combine these systems
in a single process. If it works it can be nice and fast.

The Pengine approach is promising for many applications. Would be
nice to implement clients for other languages (now only JavaScript
(including node.js) and Prolog).

If Pengines are too slow, a dedicated socket protocol is often fast
enough. You can also use shared memory to implement really fast
data exchange. Possibly we should write a tiny C library that
realises this?

Cheers --- Jan

>
> tom.
>
> On Wednesday, September 16, 2015 at 10:18:38 AM UTC-5, Jan Wielemaker wrote:
>
> On 09/16/2015 05:02 PM, Stephen Coda wrote:
> > libpl (shared) not found. Possible Reasons:
> > 1) SWI-Prolog not installed as a shared library. Install SWI-Prolog
> > (6.5.34 works just fine)
> > look in the documentation but can not find the file libpl if someone
> > could help me with this I would appreciate it have searched and
> can not
> > find enough certainly use ubuntu 12.04 and install it via PPA
>
> libpl.so has been renamed long time ago to libswipl.so for consistency
> with the executable naming and to make the naming consistent across
> OSes.
>
> Cheers --- Jan
>
Reply all
Reply to author
Forward
0 new messages