Skip to content

Julia package manager

Martin Otter edited this page Dec 5, 2018 · 9 revisions

The Julia package manager (Pkg) is used to install and manage sets of packages. It is important to first read the manual of the package manager. Pkg is very powerful, but on the other hand also quite complicated when starting with it. Below additional hints are given that are otherwise not easy to deduce:

  • The package manager defines versions of packages with the Project.toml and Manifest.toml files. However, the registered packages at METADATA define currently (Dec. 5, 2018) the dependency on other packages with file REQUIRE that must be present on the top level of every package. For example, in this file it is stated that the package requires Julia 1.0 or later, or that version x.y or a later version of package C is required. For example a line ModiaMath 0.2.5 0.3.0 in the REQUIRE file states, that at least version 0.2.5 has to be used, but not version 0.3.0 or later.

  • A very basic property is that for every Pkg-environment, exactly one version of a package is used. For example, if an environment contains two packages A and B, and in the REQUIRE file of package A it is stated that version v1 or later of package C is required and in the REQUIRE file of package B it is stated that version v2 or later of package C is required, and the latest registered version of package C is version v3, then the package manager installs exactly one version of C (it could be v1, v2, or v3, or another version). With ]status the actually used package versions of the default environment are listed.

Clone this wiki locally