# How to find out the version of a package from its module

**URL:** <https://discourse.julialang.org/t/how-to-find-out-the-version-of-a-package-from-its-module/37755>\
**Category:** General Usage\
**Created:** [April 17, 2020, 11:43am UTC](https://discourse.julialang.org/t/how-to-find-out-the-version-of-a-package-from-its-module/37755 "2020-04-17T11:43:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [April 17, 2020, 11:57am UTC](https://discourse.julialang.org/t/how-to-find-out-the-version-of-a-package-from-its-module/37755/2 "2020-04-17T11:57:29Z")

</div>

The only way to get the version of the _currently loaded package_ (as opposed to what’s in the active environment) is something like

```julia
julia> pkgversion(m::Module) = Pkg.TOML.parsefile(joinpath(dirname(string(first(methods(m.eval)).file)), "..", "Project.toml"))["version"]
pkgversion (generic function with 1 method)

julia> pkgversion(Atom)
"0.12.10"

```

Needs some error handling, of course. Also hits the file system, but I don’t think there’s a way around that anyways.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-find-out-the-version-of-a-package-from-its-module/37755)._
