Good evening,
I’ve made a small tutorial on Prolog using “swiplserver” to handle the Prolog queries. However, I’m having trouble when executing said queries after deploying my repository on binder.
Swiplserver requires having SWI Prolog installed on the environment to work, and so it fails as there’s no SWI to call on the image made by Binder.
I’ve tried several things, such as installing SWI Prolog in the postBuild (Which fails due to a lack of permissions that can’t be overrided by using SUDO), trying to pull a SWI Prolog image with a Dockerfile. All of these options have failed.
Is there any workaround I could use to make this work, or is it plainly non viable? Any help would be greatly appreciated, even telling me to drop it and find a different solution to Binder would.
Thank you for your time.
This available conda-forge recipe seems to install SWI-Prolog when I tried it on MyBinder just now. Here is a snippet of the build log for the image:
...
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
swi-prolog 9.0.4 hb97c47e_6 conda-forge
terminado 0.18.1 pyh0d859eb_0 conda-forge
tinycss2 1.3.0 pyhd8ed1ab_0 conda-forge
tk 8.6.13 noxft_h4845f30_101 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tornado 6.4.1 py310hc51659f_0 conda-forge
...
And here similar information in this snipper from the result of conda list
in the running session:
...
sniffio 1.3.1 pyhd8ed1ab_0 conda-forge
soupsieve 2.5 pyhd8ed1ab_1 conda-forge
sqlalchemy 2.0.32 py310h5b4e0ec_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
swi-prolog 9.0.4 hb97c47e_6 conda-forge
terminado 0.18.1 pyh0d859eb_0 conda-forge
tinycss2 1.3.0 pyhd8ed1ab_0 conda-forge
tk 8.6.13 noxft_h4845f30_101 conda-forge
...
The environment.yml
I used as a quick test is here.
Am I missing something?
That’s definitely odd. I did try to install SWI Prolog with conda, but it didn’t work for me. I tried to add it again to my environment.yml
name: myenv
channels:
-
defaults
-
conda-forge
dependencies: -
python=3.12.4
-
voila
-
jupyterlab
-
pip
-
swi-prolog
-
pip:
- pyswip
- swiplserver
But I can’t see it on my build log:
sniffio 1.3.1 pyhd8ed1ab_0 conda-forge
soupsieve 2.5 pyhd8ed1ab_1 conda-forge
sqlalchemy 2.0.32 py310h5b4e0ec_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
terminado 0.18.1 pyh0d859eb_0 conda-forge
tinycss2 1.3.0 pyhd8ed1ab_0 conda-forge
Well, I think I already saw what’s wrong with my environment.yml. I took the “defaults” from channels and I can see the SWI Prolog being installed by Conda.
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
swi-prolog 9.0.4 hb97c47e_6 conda-forge
swiplserver 1.0.2 pypi_0 pypi
terminado 0.18.1 pyh0d859eb_0 conda-forge
tinycss2 1.3.0 pyhd8ed1ab_0 conda-forge
I’m waiting for the imagen to deploy to verify this, but seems like the problem is solved. Many thanks, friend. Tunnel vision, what a concept.