Pkg.installed("PackageName") for Julia v1.0?

I was wondering if there is an equivalent code for Pkg.installed("PackageName") or Pkg.status("PackageName") in Julia v1.0. I want to check the version of a package installed.

Enter the package repl mode with ], then

(v1.0) pkg> st

will show the contents of your current environment (i.e. a list of installed packages and their versions)

Anyway to do it for an individual package?

Pkg.installed is available on Julia v1.0 too

julia> using Pkg; Pkg.installed()
Dict{String,Union{Nothing, VersionNumber}} with 4 entries:
  "StaticArrays"   => v"0.8.3"
  "Documenter"     => v"0.19.6+"
  "Sandbox"        => v"0.1.0"
  "BenchmarkTools" => v"0.4.1"
3 Likes

This works :

using Pkg

julia> a=Pkg.installed()
Dict{String,Union{Nothing, VersionNumber}} with 13 entries:
  "ReadStat"           => v"0.4.1"
  "BenchmarkTools"     => v"0.4.2"
  "Arpack"             => v"0.3.1"
  "WinRPM"             => v"0.4.2"
  "StatsBase"          => v"0.32.0"
  "HDF5"               => v"0.12.1"
  "IJulia"             => v"1.19.0"
  "Plots"              => v"0.26.2"
  "StatFiles"          => v"0.8.0"
  "XLSX"               => v"0.5.4"
  "DataFrames"         => v"0.19.2"
  "OnlineStats"        => v"0.27.0"
  "ApplicationBuilder" => v"0.4.0"

julia> "DataFrames" in keys(a)
true