# Programatically access version of third party package

**URL:** <https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357>\
**Category:** General Usage\
**Created:** [March 22, 2020, 7:08pm UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357 "2020-03-22T19:08:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mfh/32/13787_2.png) [@mfh](https://discourse.julialang.org/u/mfh)\
**Post date:** [March 22, 2020, 7:08pm UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/1 "2020-03-22T19:08:03Z")

</div>

I would like to access the version information of an installed third-party package in terms of a `VersionNumber` object or similar. Is this possible somehow? I did bit of digging in the documentation of Base and Pkg, but nothing useful popped up.

To clearify: Essentially I am searching for the python `package. __version__ ` equivalent in julia, i.e. some mechanism (or standard) where one can expect the version info of a package to be available or exported.

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [March 22, 2020, 7:13pm UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/2 "2020-03-22T19:13:32Z")

</div>

You may be interested in `Pkg.dependencies`.

[https://julialang.github.io/Pkg.jl/dev/api/#Pkg.dependencies](https://julialang.github.io/Pkg.jl/dev/api/#Pkg.dependencies)

---

<div class="post-metadata">

**Author:** ![mfh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mfh/32/13787_2.png) [@mfh](https://discourse.julialang.org/u/mfh)\
**Post date:** [March 22, 2020, 7:17pm UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/3 "2020-03-22T19:17:36Z")

</div>

Thanks @dilumaluthge Since I just started exploring 1.4 `Pkg.dependencies()` and `Pkg.project()` were new to me. Definitely an interesting pointer. Unfortunately on the current project, I’d need a julia 1.3 solution as well …

---

<div class="post-metadata">

**Author:** ![mfh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mfh/32/13787_2.png) [@mfh](https://discourse.julialang.org/u/mfh)\
**Post date:** [March 22, 2020, 7:46pm UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/4 "2020-03-22T19:46:33Z")

</div>

So from all digging I did inside Pkg. It seems `Pkg.dependencies()` is really the simplest way to do this. As far as I can judge, most of the underlying scaffolding it uses has been added just in 1.4 … so maybe I’m just out of luck for 1.3. Still happy if anyone comes up with a clever idea 😄.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 23, 2020, 8:22am UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/5 "2020-03-23T08:22:12Z")

</div>

> [@mfh](#):
>
> so maybe I’m just out of luck for 1.3.

Since 1.4 was just released, presumably it can be installed in any environment that had a working 1.3 installation?

---

<div class="post-metadata">

**Author:** ![mfh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mfh/32/13787_2.png) [@mfh](https://discourse.julialang.org/u/mfh)\
**Post date:** [March 23, 2020, 12:21pm UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/6 "2020-03-23T12:21:54Z")

</div>

Thanks for the suggestion. In this case it’s a bit convoluted, because I want to use julia to provide some functionality for a python-based package and in order to make the transition for people smooth, I’d want to be as broad as possible wrt. julia version as possible.

On the other hand most people will need install julia in this context either way, so one might as well insist they go for 1.4.

---

<div class="post-metadata">

**Author:** ![mfh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mfh/32/13787_2.png) [@mfh](https://discourse.julialang.org/u/mfh)\
**Post date:** [March 24, 2020, 6:52am UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/7 "2020-03-24T06:52:20Z")

</div>

On that note: In Julia 1.3 there is `Pkg.installed()`, which returns a list of direct dependencies and their versions. This command is, however, deprecated in 1.4.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 24, 2020, 7:02am UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/8 "2020-03-24T07:02:36Z")

</div>

What is the problem that you are trying to solve?

---

<div class="post-metadata">

**Author:** ![mfh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mfh/32/13787_2.png) [@mfh](https://discourse.julialang.org/u/mfh)\
**Post date:** [March 24, 2020, 7:32am UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/9 "2020-03-24T07:32:22Z")

</div>

Simply put: I want to return the version of a particular installed Julia package to python using `pyjulia`.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 24, 2020, 8:41am UTC](https://discourse.julialang.org/t/programatically-access-version-of-third-party-package/36357/10 "2020-03-24T08:41:59Z")

</div>

It would be easier to help if you described _what_ you are trying to achieve, instead of _how_ you imagine doing it. cf

> **[XY problem](https://en.wikipedia.org/wiki/XY_problem)**
>
> The XY problem is a communication problem encountered in help desk, technical support, software engineering, or customer service situations where the question is about an end user's attempted solution (Y) rather than the root problem itself (X).
> The XY problem obscures the real issues and may even introduce secondary problems that lead to miscommunication, resource mismanagement, and sub-par solutions. The solution for the support personnel is to ask probing questions as to why the information i...

In particular, managing packages and versions in Julia is _declarative_: you specify what you need, and it will be taken care of. Trying to do anything else is going against the grain.
