I downloaded a Mathematica package. It came as a file with the .paclet
extension. How can I install or uninstall it?
-
$\begingroup$ 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. $\endgroup$– SzabolcsApr 5, 2017 at 11:34
-
2$\begingroup$ Congratulations on Legendary! :D $\endgroup$– Mr.WizardApr 5, 2017 at 12:27
-
$\begingroup$ @Mr.Wizard Wow, thanks! If you don't point it out, I would not have noticed ... $\endgroup$– SzabolcsApr 5, 2017 at 17:48
1 Answer
Update: The paclet-related functionality is documented in Mathematica 12.1. See PacletInstall
.
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:
-
$\begingroup$ 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?!) $\endgroup$– murraySep 4, 2017 at 21:32 -
$\begingroup$ @murray I do not know. I always assumed that it also updates some database (perhaps those .pmd files). $\endgroup$– SzabolcsSep 4, 2017 at 21:42
-
$\begingroup$ @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 ... $\endgroup$– SzabolcsSep 4, 2017 at 21:45 -
$\begingroup$ Strange that there's no documentation on
PacletUninstall
andPacletInstall
-- unless Wolfram doesn't really want 3rd parties to distribute adding in the form of paclets. $\endgroup$– murraySep 5, 2017 at 17:12 -
$\begingroup$ @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. $\endgroup$– SzabolcsSep 5, 2017 at 17:23