# Can't call library clpfd (Swish)

**URL:** <https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547>\
**Category:** SWI-Prolog web site and services\
**Tags:** swish\
**Created:** [June 21, 2020, 9:55am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547 "2020-06-21T09:55:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanjuro](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Sanjuro](https://swi-prolog.discourse.group/u/Sanjuro)\
**Post date:** [June 21, 2020, 9:55am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/1 "2020-06-21T09:55:24Z")

</div>

I’ve been looking into some classical problems in prolog recently and stumbled upon the 8queens problem in this SWISH notebook: [https://swish.swi-prolog.org/example/clpfd\_queens.pl](https://swish.swi-prolog.org/example/clpfd_queens.pl).  
The problem is that I can’t apparently access the clpfd library from SWISH and, while that seems strange to me since I found the example in a SWISH notebook, i can’t find any way to solve the issue.

EDIT: i hosted locally SWISH and obviously solved the sandbox issue.  
I followed these instructions: [https://github.com/SWI-Prolog/swish/blob/master/README.md](https://github.com/SWI-Prolog/swish/blob/master/README.md)  
Works like a dream

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 21, 2020, 10:04am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/2 "2020-06-21T10:04:12Z")

</div>

> [@Sanjuro](#):
>
> i can’t find any way to solve the issue.

To keep users from using the Prolog code to hack into the site, the code is run in a sandbox and in the sandbox only certain predicates are allowed thus the error message.

![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/0/06ad74d7ab3f79f375fcc69e4e09efadf2f93785.png)

`No permission to call sandboxed <predicate>`

Apparently the problem has [occurred before](https://swi-prolog.discourse.group/t/no-permission-to-call-sandboxed-source-location-2216-2218-error/1584) and can be fixed with restarting SWISH but I don’t have that ability.

---

<div class="post-metadata">

**Author:** ![Sanjuro](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Sanjuro](https://swi-prolog.discourse.group/u/Sanjuro)\
**Post date:** [June 21, 2020, 10:08am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/3 "2020-06-21T10:08:43Z")

</div>

so there’s no way i’m running that code online, right?. Would Installing SWISH locally solve the issue? I really like the editor and would be a real shame if i had to drop it.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 21, 2020, 10:13am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/4 "2020-06-21T10:13:52Z")

</div>

> [@Sanjuro](#):
>
> so there’s no way i’m running that code online, right?

From what I read it should work online once SWISH is restarted and when Jan sees this post he will restart SWISH. Jan usually visits the sites a few times a day but less often on weekends.

If you want to know how the code works, see: [Understanding CLP(FD) Prolog code of N-queens problem](https://stackoverflow.com/questions/53406374/understanding-clpfd-prolog-code-of-n-queens-problem)

---

<div class="post-metadata">

**Author:** ![Sanjuro](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Sanjuro](https://swi-prolog.discourse.group/u/Sanjuro)\
**Post date:** [June 21, 2020, 10:15am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/5 "2020-06-21T10:15:59Z")

</div>

Cool! Thank you for your support!

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 21, 2020, 11:00am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/6 "2020-06-21T11:00:09Z")

</div>

> [@Sanjuro](#):
>
> I followed these instructions: [https://github.com/SWI-Prolog/swish/blob/master/README.md](https://github.com/SWI-Prolog/swish/blob/master/README.md)  
> Works like a dream

It might be easier to use SWI-Prolog by just installing SWI-Prolog on your machine.

Windows: [Install SWI-Prolog development version on Windows 10](https://swi-prolog.discourse.group/t/install-swi-prolog-development-version-on-windows-10/1131)

Linux: [Install SWI-Prolog development version on Ubuntu using PPA](https://swi-prolog.discourse.group/t/install-swi-prolog-development-version-on-ubuntu-using-ppa/2402)

---

<div class="post-metadata">

**Author:** ![Sanjuro](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@Sanjuro](https://swi-prolog.discourse.group/u/Sanjuro)\
**Post date:** [June 21, 2020, 11:35am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/7 "2020-06-21T11:35:02Z")

</div>

yes i mean of course it’s easier but i really like SWISH’s whole graphical interface, the fact that highlights the text in the knowledge base while executing the trace/0 command etc…  
I really wanted to use SWISH that’s why i posted this thread in the first place.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 21, 2020, 11:38am UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/8 "2020-06-21T11:38:30Z")

</div>

One should use what works best. 😉

Was not sure if you knew there were other options.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 21, 2020, 3:27pm UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/9 "2020-06-21T15:27:44Z")

</div>

> [@EricGT](#):
>
> Apparently the problem has [occurred before](https://swi-prolog.discourse.group/t/no-permission-to-call-sandboxed-source-location-2216-2218-error/1584) and can be fixed with restarting [SWISH](https://swish.swi-prolog.org/) but I don’t have that ability.

Restarted. Unfortunately I only have a little laptop around and no time to dig and see why this sometimes happens.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [June 21, 2020, 3:35pm UTC](https://swi-prolog.discourse.group/t/cant-call-library-clpfd-swish/2547/10 "2020-06-21T15:35:55Z")

</div>

What it looks like when working.

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/f/f5c89c624ec11076955966570526871f0397f51c.png)
