# Get names and versions of loaded modules

**URL:** <https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [June 30, 2020, 8:05am UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289 "2020-06-30T08:05:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [June 30, 2020, 8:05am UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/1 "2020-06-30T08:05:39Z")

</div>

Is there a way to get the names and version numbers of the currently loaded modules in a Julia session?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 30, 2020, 11:16am UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/2 "2020-06-30T11:16:52Z")

</div>

You can get the modules with `Base.loaded_modules`. Julia itself doesn’t have a concept of versions on modules so that doesn’t exist.

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [June 30, 2020, 11:20am UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/3 "2020-06-30T11:20:32Z")

</div>

@uwechsler The modules have not version number, I think you want to say package. With the name of a loaded package, you can get the version number with [https://github.com/KlausC/PkgVersion.jl](https://github.com/KlausC/PkgVersion.jl).

---

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [July 1, 2020, 12:39pm UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/4 "2020-07-01T12:39:29Z")

</div>

Thank you a lot!

@kristoffer.carlsson Is it “save” to use `Base.loaded_modules` with respect to future `Julia 1.x` releases? From the answer to this question [Using an already-loaded module in 0.7 - #6 by StefanKarpinski](https://discourse.julialang.org/t/using-an-already-loaded-module-in-0-7/11587/6) I assumed I should avoid using it.  
@dmolina you are right, I was talking about packages. This package helps already a lot. I want to figure out what pacakges (and versions) are loaded in a custom system image. At leaste, for my own packages I am able to do that now, thanks.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 1, 2020, 1:20pm UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/5 "2020-07-01T13:20:49Z")

</div>

> [@uwechsler](#):
>
> Is it “save” to use `Base.loaded_modules` with respect to future `Julia 1.x` releases?

It depends what you mean with safe. It is an internal variable so it is possible it could change in the future, yes. There isn’t really any other way to do it right now though.

---

<div class="post-metadata">

**Author:** ![hhaensel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hhaensel/32/1207_2.png) [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Post date:** [September 6, 2022, 6:06pm UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/6 "2022-09-06T18:06:11Z")

</div>

Here’s a one-liner for finding the version number of a loaded module, e.g. `HTTP`:

```julia
using Pkg
using HTTP

Pkg.dependencies(x -> x.version, findfirst(p -> p == HTTP, Base.loaded_modules).uuid)

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 25, 2024, 3:03pm UTC](https://discourse.julialang.org/t/get-names-and-versions-of-loaded-modules/42289/7 "2024-03-25T15:03:22Z")

</div>

There is now also `pkgversion`.
