How to brew install swi-prolog 8.4.3 when 9.0.0 is out

It finally works! The thread suggested by @EricGT was very useful. Here is how:

For some reason downloading SWI-Prolog 8.4.3 from the website is causing me another slew of errors. Therefore I went back to SWI-Prolog 9.x via homebrew.

By implementing D.Cox’s pyswip PR #133, I get the “Exception: swi-prolog version number could not be determined”.

Then I implemented @hakank 's suggestion by amending Cox’s “PL_version = _lib.PL_version” to “PL_version = _lib.PL_version_info”

Viola! Thankfully, it works! In case anyone is curious, I have been using Aleph.