libpl error on Vista

131 views
Skip to first unread message

oldman

unread,
Feb 23, 2010, 11:02:23 AM2/23/10
to pyswip
I was just starting with pyswip. I got the following error:

libpl (shared) not found. Possible reasons:
1) SWI-Prolog not installed as a shared library. Install SWI-Prolog
(5.6.34 works just fine)
...

However libpl.dll is actually visible in Env variable path. I am using
Vista and SWI 5.6.64
Have anybody some idea what the problems is
Thanks in advance

oldman

unread,
Feb 23, 2010, 4:22:40 PM2/23/10
to pyswip
Well I have discovered what is going on:
libpl.dll loading requires pcthreadVC.dll already being loaded (so
dependencies are not handled). Thus, if I load both dlls manually in
Pyhton then I can get pyswip working. However, it just functions when
Python is being called from an Administrator Command prompt. Working
using IDLE Shell does not work. I don't know why (A Vista security
issue perhaps?)

oldman

unread,
Feb 23, 2010, 10:00:28 PM2/23/10
to pyswip
It was actually simple: python expects the working directory (WD)
contains the SWI dlls (libpl, pthreadVC, etc)
Thus, I just changed the WD (in my case 'C:/Program Files (x86)/pl/
bin)

import os
os.chdir('C:/Program Files (x86)/pl/bin')
from pyswip import Prolog
prolog = Prolog()

and so on. It seems to work correctly now

yuce

unread,
Feb 24, 2010, 4:10:16 AM2/24/10
to pyswip
Thanks for sharing your solution, but I suspect that C:/Program Files
(x86)/pl/bin is not really in your PATH variable , that maybe what
caused the problem in the first place. Windows expects a DLL to be on
the PATH "or" in the same directory with the executable/runnable.

Can you please try running "plcon.exe" or "plwin.exe" in a console and
see whether those run successfully?

Thanks,

Yuce

Carlos Loria-Saenz

unread,
Feb 24, 2010, 9:28:46 AM2/24/10
to pys...@googlegroups.com
Oh no, Yuce C:/Program Files (x86)/pl/bin was always registered in my
Windows PATH, that was exactly my concern in python. For some reason
python doesn't use path dirs (sys.path) for loading dlls unless they
are in python interpreter working directory. At least in Vista.
Of course I can call plcon and plwin out from my Prompt.
Thank-you very much for your answers and for the tool itself. We want
to explore it to see if it can be used for a prototype in a course
where we prefer using Windows. Maybe we find some else here who helps
you mainting it, perhaps
Regards

> --
> You received this message because you are subscribed to the Google Groups "pyswip" group.
> To post to this group, send email to pys...@googlegroups.com.
> To unsubscribe from this group, send email to pyswip+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyswip?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages