Out of box, attempting to load the janus library threw an error saying that the Python dynamic lib couldn’t be found. janus.so seems to want Python 3.9.0.
I figured that it would just be a matter of setting something like DYLD_LIBRARY_PATH but it seems that Apple has locked things down further so that now the dynamic lib search path is burned into the binary.
To get things to work I had to (1) install Python 3.9 (2) physically alter jason.so using the install_name_tool utility to add paths under \usr\local\ to Python 3.9, and then sprinkle various symlinks around so that the search for the dylib could succeed. It’s a bit byzantine.
That is a Homebrew issue. Well, also a bit of a Python issue. Each version of Python comes with a C API that is typically not binary compatible with other versions. So, you are stuck with the version of Python used to build Janus There is something called a “Python 3 library” that offers a somewhat limited consistent interface and loads the currently installed Python version. However, this only seems to be in use for the Python.org Windows distribution of Python.
So, as is, you need to compile Janus against the Python you want to use. That is not a big issue when installing from source, but it makes binary distributions rather impractical. If anyone knows a way around, please stand up.
Note that you can use otool to modify the dynamic library dependencies. I wonder whether that may help making some version transitions. Janus should work with version 3.6 or later. There are a couple of compile time decisions that choose between older and later APIs, notably wrt. Python initialization.
Thanks Jan. Yeah, install_name_tool is part of the otool set, and that’s what I used to change the RPATH set in janus.so. I guess in general the answer is as you say, to build from source …
If only the Python world were as lucid and elegant as that of SWI Prolog …