I downloaded a Mathematica package. It came as a file with the .paclet extension. How can I install or uninstall it?

  • This question exists so that people who distribute their packages as paclets can direct users here for installation instructions. If you find that the answer is not clear enough, feel free to improve it—it's community wiki. But please keep it concise. – Szabolcs Apr 5 '17 at 11:34
  • 1
    Congratulations on Legendary! :D – Mr.Wizard Apr 5 '17 at 12:27
  • @Mr.Wizard Wow, thanks! If you don't point it out, I would not have noticed ... – Szabolcs Apr 5 '17 at 17:48
up vote 14 down vote accepted

This answer is for people who are not interested in package development, and just need to install a Mathematica package which they obtained as a .paclet file.

Note: Before using the functions in this guide, it may be necessary to evaluate Needs["PacletManager`"]. Specifically, this is needed when your notebooks's default context is set to "Unique to This Notebook".

Installing

Packages distributed as paclets can be installed using the PacletInstall function. Evaluate this function with its argument the full path to the downloaded .paclet file.

For example, if SomePackage-1.0.0.paclet was downloaded into the ~/Downloads directory, then evaluate

PacletInstall["~/Downloads/SomePackage-1.0.0.paclet"]

You may use Insert → File Path... to easily insert the path to this file.

Getting information

.paclet files are typically named as SomePackage-1.0.0.paclet. Here SomePackage is the paclet name and 1.0.0 is its version. To get information about the active version of a currently installed paclet, use PacletInformation with its name:

PacletInformation["SomePackage"]

To list all installed versions of a paclet, use

PacletFind["SomePackage"]

Typically the latest version will be the active one. This is listed first by PacletFind.

Uninstalling

To uninstall all versions of a paclet named SomePackage, use

PacletUninstall["SomePackage"]

Warning: Mathematica uses many system paclets. Do not attempt to uninstall these. Only uninstall paclets that you have installed yourself.

Paclets with documentation

Packages that come with documentation may show up in the Documentation Center's Add-ons browser. Open the Documentation through the Help menu and look for the Add-ons and Packages link in the lower right corner:

Clicking it will show a list of those installed packages (both paclets and traditional ones) that come with documentation. The list may have buttons for opening the package's documentation or for uninstalling it.

Information for developers

If you are looking to distribute your own packages as paclets, read the following threads:

  • What does PacletUninstall actually do, besides deleting the indicated paclet in $UserBaseDirectory/Paclets/Repository(to abuse a notation)? that is, is some database elsewhere in $UserBaseDirectory also modified? (And why did Wolfram have to use the name "paclet". which drives my auto-spell-correction crazy, insisting on changing it to "packet" each time I type it?!) – murray Sep 4 '17 at 21:32
  • @murray I do not know. I always assumed that it also updates some database (perhaps those .pmd files). – Szabolcs Sep 4 '17 at 21:42
  • @murray On a cursory inspection, it seems to delete that directory, then do something similar to RebuildPacletData[] (which is the function that modifies databases). I didn't dig deeper. It's late here, going to bed ... – Szabolcs Sep 4 '17 at 21:45
  • Strange that there's no documentation on PacletUninstall and PacletInstall -- unless Wolfram doesn't really want 3rd parties to distribute adding in the form of paclets. – murray Sep 5 '17 at 17:12
  • @murray These functions have been around for a very long time (maybe v6?), but they were originally meant for internal use only. They are still officially undocumented, but now there are examples coming directly from WRI that use the paclet format. I no longer feel that using these functions is a bad idea, and I wouldn't be surprised if they became officially supported and documented in the future. – Szabolcs Sep 5 '17 at 17:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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