# Package install errors - How to resolve after SWI-Prolog changed to using HTTPS

**URL:** <https://swi-prolog.discourse.group/t/package-install-errors-how-to-resolve-after-swi-prolog-changed-to-using-https/895>\
**Category:** Nice to know\
**Created:** [July 1, 2019, 10:59am UTC](https://swi-prolog.discourse.group/t/package-install-errors-how-to-resolve-after-swi-prolog-changed-to-using-https/895 "2019-07-01T10:59:44Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [July 1, 2019, 10:59am UTC](https://swi-prolog.discourse.group/t/package-install-errors-how-to-resolve-after-swi-prolog-changed-to-using-https/895/1 "2019-07-01T10:59:44Z")

</div>

Posting this info here so that it can be indexed by search engines and more easily found.

Recently SWI-Prolog switched to using [HTTPS](https://swi-prolog.discourse.group/t/www-swi-prolog-org-goes-https/811) which broke some things for older versions of SWI-Prolog (pre 8.0.3), namely the ability to install packages.

Here are examples of the errors:

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

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

?- pack_install(list_util).
% Contacting server at http://www.swi-prolog.org/pack/query ...
ERROR: url `'https://www.swi-prolog.org/pack/query'' does not exist (status(500,Internal Server Error))
ERROR: In:
ERROR: [18] throw(error(existence_error(url,'https://www.swi-prolog.org/pack/query'),context(_8290,...)))
ERROR: [16] http_open:try_http_proxy(direct,[uri('http://www.swi-prolog.org/pack/query'),...|...],_8326,[post(...),...]) at c:/program files/swipl/library/http/http_open.pl:425
ERROR: [14] <meta call>
ERROR: [13] '$sig_atomic'(prolog_pack:http_open('http://www.swi-prolog.org/pack/query',_8420,...)) <foreign>
ERROR: [12] setup_call_catcher_cleanup(prolog_pack:http_open('http://www.swi-prolog.org/pack/query',_8464,...),prolog_pack:read_reply(_8476,_8478,_8480),_8450,prolog_pack:close(_8490)) at c:/program files/swipl/boot/init.pl:467
ERROR: [10] prolog_pack:query_pack_server(locate(list_util),_8522,[]) at c:/program files/swipl/library/prolog_pack.pl:1719
ERROR: [9] prolog_pack:pack_default_options(list_util,list_util,[],_8564) at c:/program files/swipl/library/prolog_pack.pl:516
ERROR: [8] prolog_pack:pack_install(list_util) at c:/program files/swipl/library/prolog_pack.pl:457
ERROR: [7] <user>
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.
?- 

?- pack_list(X).
% Contacting server at http://www.swi-prolog.org/pack/query ...
ERROR: url `'https://www.swi-prolog.org/pack/query'' does not exist (status(500,Internal Server Error))
ERROR: In:
ERROR: [18] throw(error(existence_error(url,'https://www.swi-prolog.org/pack/query'),context(_1278,...)))
ERROR: [16] http_open:try_http_proxy(direct,'<garbage_collected>','<garbage_collected>','<garbage_collected>') at c:/program files/swipl/library/http/http_open.pl:425
ERROR: [14] <meta call>
ERROR: [13] '$sig_atomic'(prolog_pack:http_open('http://www.swi-prolog.org/pack/query',_1376,...)) <foreign>
ERROR: [12] setup_call_catcher_cleanup('<garbage_collected>',prolog_pack:read_reply(_1418,_1420,_1422),_1406,prolog_pack:close(_1432)) at c:/program files/swipl/boot/init.pl:467
ERROR: [10] prolog_pack:query_pack_server('<garbage_collected>',_1464,[]) at c:/program files/swipl/library/prolog_pack.pl:1719
ERROR: [9] prolog_pack:pack_search(_1496) at c:/program files/swipl/library/prolog_pack.pl:365
ERROR: [7] <user>
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.
?- 

```

To resolve these errors SWI-Prolog needs to be upgraded.

While most users work on Unix, I use Windows and will demonstrate this using Windows.

Uninstall SWI-Prolog

1. Close all running instances of SWI-Prolog.
2. Locate `Uninstall.exe` for SWI-Prolog. On my system it is located in `C:\Program Files\swipl`
3. Run `Uninstall.exe` and respond to prompts.
4. Verify that the SWI-Prolog directory is empty. Delete any remaining files manually.

Install latest version of SWI-Prolog

1. Navigate to [https://www.swi-prolog.org/Download.html](https://www.swi-prolog.org/Download.html)
2. Click [Stable release](https://www.swi-prolog.org/download/stable)
3. Click [SWI-Prolog **8.0.3-1** for Microsoft Windows (64 bit)](https://www.swi-prolog.org/download/stable/bin/swipl-8.0.3-1.x64.exe). This will start a download.
4. When download completes run `swipl-8.0.3-1.x64.exe`. On my system it is located in `C:\Users\Eric\Downloads`
5. Start SWI-Prolog

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

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

```

Query and install of packages should work.

```prolog
?- pack_list(list_util).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
p list_util@0.13.0 - Predicates for working with lists
true.

?- pack_install(list_util).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Select download location for list_util@0.13.0
   (1) * GIT repository at https://github.com/mndrix/list_util.git
   (2) https://github.com/mndrix/list_util/archive/v0.13.0.zip
   (3) Cancel

Your choice? 1
% Cloning into 'c:/users/eric/appdata/roaming/swi-prolog/pack/list_util'...
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "list_util.git" was downloaded 67 times
Package: list_util
Title: Predicates for working with lists
Installed version: 0.13.0
Author: Michael Hendricks <michael@ndrix.org>
Maintainer: Michael Hendricks <michael@ndrix.org>
Packager: Michael Hendricks <michael@ndrix.org>
Home page: https://github.com/mndrix/list_util
Download URL: https://github.com/mndrix/list_util/archive/v0.13.0.zip
Activate pack "list_util" Y/n? 
true.

```

* * *

**Added many many months later**

[Install SWI-Prolog development version on Windows 10](https://swi-prolog.discourse.group/t/install-swi-prolog-development-version-on-windows-10/1131)  
[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:** ![jamesnvc](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jamesnvc/32/14_2.png) [@jamesnvc](https://swi-prolog.discourse.group/u/jamesnvc)\
**Post date:** [July 1, 2019, 3:02pm UTC](https://swi-prolog.discourse.group/t/package-install-errors-how-to-resolve-after-swi-prolog-changed-to-using-https/895/2 "2019-07-01T15:02:54Z")

</div>

Do you want to pin this for a few weeks?

---

<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:** [July 1, 2019, 3:05pm UTC](https://swi-prolog.discourse.group/t/package-install-errors-how-to-resolve-after-swi-prolog-changed-to-using-https/895/4 "2019-07-01T15:05:41Z")

</div>

Pinned globally on July 1, 2019, 3:05pm UTC


