I want to use GitHub as a paclet server, but this fails:

 "Site" -> "https:/github.com/paclets/Repository"

PacletSiteUpdate::err: An error occurred attempting to update paclet information from site https:/github.com/b3m2a1/PacletServer. Does not appear to be a valid paclet site

PacletInstall::notavail: No paclet named ServiceConnection_StackExchange is available for download from any currently enabled paclet sites.


Is there a work around?

See also: How to distribute Mathematica packages as paclets? and this answer


First things first we set up the paclet server in the normal way as described here or here.

Then all we need to do is pass the "raw.githubusercontent" version of that so that the resources themselves get downloaded instead of the HTML pages:

 "Site" -> 

"Name" -> "ServiceConnection_StackExchange", "Version" -> "1.0.0", 
 "Description" -> "A service connection to the Stack Exchange API. \
Supports the majority of the functions defined in the API", 
 "Extensions" -> {{
   "Kernel", "Root" -> ".", 
    "Context" -> "ServiceConnection_StackExchange`"}, {
   "FrontEnd", "Prepend" -> True}}, 
 "Location" -> "~/Library/Mathematica/Paclets/Repository/\


As Szabolcs points out, you must use "http://raw.githubusercontent.com". The PacletManger refuses to use the "https://" form.

  • 3
    $\begingroup$ Do point out the HTTPS thing for those who wouldn't realize its importance. $\endgroup$ – Szabolcs Sep 5 '17 at 20:37
  • $\begingroup$ a) GitHubServer should be PacletServer right? b) I think this topic deserves a one line intro about the setup because users could be confused about that is really going on. $\endgroup$ – Kuba Jan 7 '19 at 10:20
  • $\begingroup$ @Kuba the GitHubServer was a repo I set up specifically for this question and at some point must have removed. I'll change it to the public server. That's a better one to point to. $\endgroup$ – b3m2a1 Jan 7 '19 at 16:09
  • $\begingroup$ How can you pass on Authentication and/or Header information to PacletSiteRegister and/or PacletSiteUpdate to access private GitHub repos? $\endgroup$ – István Zachar Apr 8 at 13:01
  • $\begingroup$ @IstvánZachar there’s no general way, but you can intercept the behavior of PacletInstall to do so, e.g. write a PrivatePacletInstall that can forward auth details to URLFetch when it’s called $\endgroup$ – b3m2a1 Apr 8 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.