A bundled Python interface

Note: This is just some rapid feedback, will see if I can get it working today but if you have a clue that would help, I am listening. :slightly_smiling_face:

Just updated SWI-Prolog to daily build for Windows

https://www.swi-prolog.org/download/daily/bin/

https://www.swi-prolog.org/download/daily/bin/swipl-w64-2023-08-06.exe

Here is the result

Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.12-14-g35822504d)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- py_version.
ERROR: c:/program files/swipl/library/janus.pl:93:
ERROR:    c:/program files/swipl/library/janus.pl:93: Initialization goal raised exception:
ERROR:    The specified module could not be found.

ERROR:    In:
ERROR:      [53] throw(error(shared_object(open,'The specified module could not be found.\r\n'),context(...,_624)))
ERROR:      [51] <meta call>
ERROR:      [50] with_mutex('$foreign',load_foreign_library(foreign(janus),janus,[...])) <foreign>
ERROR:      [48] '$run_init_goal'(shlib:load_foreign_library(...,...)) at c:/program files/swipl/boot/init.pl:823
ERROR:      [47] catch(system:'$run_init_goal'(...),_766,system:'$initialization_error'(_788,...,...)) at c:/program files/swipl/boot/init.pl:563
ERROR:      [46] catch_with_backtrace(system:'$run_init_goal'(...),_824,system:'$initialization_error'(_846,...,...)) at c:/program files/swipl/boot/init.pl:643
ERROR:    
ERROR:    Note: some frames are missing due to last-call optimization.
ERROR:    Re-run your program in debug mode (:- debug.) to get more detail.
ERROR: Exported procedure janus:py_free/1 is not defined
ERROR: Exported procedure janus:py_iter/3 is not defined
ERROR: Exported procedure janus:py_with_gil/1 is not defined
ERROR: Exported procedure janus:py_call/1 is not defined
ERROR: Exported procedure janus:py_call/2 is not defined
ERROR: Exported procedure janus:py_call/3 is not defined
ERROR: Exported procedure janus:py_iter/2 is not defined
ERROR: [Thread 1]: exception handler failed to define janus:py_call/2
ERROR: Unknown procedure: janus:py_call/2
ERROR: In:
ERROR:   [11] janus:py_call(sys:version,_11474)
ERROR:   [10] janus:py_version at c:/program files/swipl/library/janus.pl:112
ERROR:    [9] toplevel_call(user:user:py_version) at c:/program files/swipl/boot/toplevel.pl:1173
   Exception: (11) janus:py_call(sys:version, _9754) ? 
?- pwd.
% c:/users/Groot/documents/prolog/
true.

Other info

From Windows command line

C:\Users\Groot>where swipl
C:\Program Files\swipl\bin\swipl.exe

C:\Users\Groot>python -V
Python 3.10.0

C:\Users\Groot>where python
C:\Users\Groot\AppData\Local\Programs\Python\Python310\python.exe
C:\Users\Groot\AppData\Local\Microsoft\WindowsApps\python.exe

SWI-Prolog is started from the Windows taskbar by clicking an icon (shortcut - *.lnk) , the shortcut uses this command line

“C:\Program Files\swipl\bin\swipl-win.exe” --win_app

The Windows install wizard noted the Python interface

image

The file janus.pl line 93 shows

:- use_foreign_library(foreign(janus), [visibility(global)]).


At this point not sure if the DLL was created automatically or I need to create it but will run that down; just wanted to give you some rapid feedback.