Determine the version of a specific package

How can I get the version number for a specific package?

The obvious way is to get a dictionary with all installed packages, and then a filter for the one you are interested in:

pkgs = Pkg.installed(); pkgs["Datetime"] 

Listing all installed packages is very slow, especially if there are many packages.

+11
julia-lang julia
source share
3 answers

EDIT: For Julia version 1. 0+

Pkg.installed seems to have "regressed" with the new package system. For Pkg.installed arguments, Pkg.installed . So the original OP method seems to be the best you can do at the moment.

 pkgs = Pkg.installed(); pkgs["Datetime"] 

EDIT: For Julia version prior to 0.6.4

You can pass the string to Pkg.installed . For example:

 pkgs = Pkg.installed("JuMP") 

I often check available call arguments with methods . For example:

 julia> methods(Pkg.installed) # 2 methods for generic function "installed": installed() at pkg/pkg.jl:122 installed(pkg::AbstractString) at pkg/pkg.jl:129 

or

 julia> Pkg.installed |> methods # 2 methods for generic function "installed": installed() at pkg/pkg.jl:122 installed(pkg::AbstractString) at pkg/pkg.jl:129 
+8
source share

I would try Pkg.status("PackageName")

This will display a small ad campaign with the package name.

Here is an example

 julia> Pkg.status("QuantEcon") - QuantEcon 0.0.1 master 
+6
source share

In Julia 1.1 you can use

 (v1.1) pkg> status "name_of_the_package" 

to find the version of any package in a given environment.

0
source share

All Articles