# Why do I have to install PGFPlotsX manually?

**URL:** <https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140>\
**Category:** Visualization\
**Tags:** package\
**Created:** [May 19, 2023, 9:58pm UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140 "2023-05-19T21:58:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [May 19, 2023, 9:58pm UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/1 "2023-05-19T21:58:58Z")

</div>

After `add`ing and importing a package that has PGFPlotsX as a dependency, and checking that the dependency has been added to my environment’s Manifest (confirmed by entering `st -m` in package mode), I get an error when calling a function from the package that calls `pgfplotsx()`; I’m obligated to `add` that plotting back end to my environment manually. This doesn’t happen with other dependent packages, just PGFPlotsX.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 20, 2023, 7:00am UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/2 "2023-05-20T07:00:45Z")

</div>

Can you be more specific on the package in question and the error that you get? Do you have a minimum working example?

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [May 20, 2023, 8:30am UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/3 "2023-05-20T08:30:21Z")

</div>

Adding a dependency to your Manifest.toml doesn’t mean it will be installed automatically. You need to run `instantiate` in Pkg mode to install all dependencies.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 20, 2023, 11:27am UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/4 "2023-05-20T11:27:07Z")

</div>

I might misunderstand your issue but in general you shouldn’t expect to be able to use any functionality of dependencies of packages you are using, for this to work the package you are using has to reexport the names of its dependencies.

As an example, `CSV` depends on `Tables` but you can’t use eg `columntable` after doing `using CSV`. You are able to do `Tables.columntable()` though to access the unexported functionality of the dependency. On the other hand, `DataFramesMeta` depends on `DataFrames` and reexports the whole package, so `using DataFramesMeta` will make all of DataFrames available.

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [May 20, 2023, 2:50pm UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/5 "2023-05-20T14:50:47Z")

</div>

As I said,

> [@LeePhillips](#):
>
> I get an error when calling a function from the package that calls `pgfplotsx()`;

I don’t expect to be able to call pgfplotsx() myself without installing and importing it.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [May 20, 2023, 2:54pm UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/6 "2023-05-20T14:54:59Z")

</div>

It would be much easier to diagnose with a reproducible example. My best guess is that it could be something to do with package extensions, but that might be completely off.

---

<div class="post-metadata">

**Author:** ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Post date:** [May 20, 2023, 3:43pm UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/7 "2023-05-20T15:43:45Z")

</div>

Well, after upgrading this problem seems to have gone away. It may have had something to do with the bug that was exercised when using Plots with PGFPlotsX, that was fixed in v1.38.12 . Thanks for your help, and sorry for the bother.

---

<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:** [May 23, 2023, 7:32am UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140/8 "2023-05-23T07:32:20Z")

</div>

> [@nilshg](#):
>
> in general you shouldn’t expect to be able to use any functionality of dependencies of packages you are using

Indeed. Not loading a dependency unless it is explicitly added to the project is a feature, not a bug.

Packages can change their dependencies in ways that do not involve the exposed API with changes in the patch version (eg recently I replaced uses of UnPack.jl with SimpleUnPack.jl in various packages), so one cannot rely on dependencies being available.
