# Question regarding metapackages under v1.0

**URL:** <https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164>\
**Category:** General Usage\
**Tags:** package\
**Created:** [November 5, 2018, 12:00pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164 "2018-11-05T12:00:53Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 12:00pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/1 "2018-11-05T12:00:53Z")

</div>

I have noticed that metapackages behave differently under v1.0 than under v0.6. Specifically, I added ValidatedNumerics to my v1.0.1 installation. While this installs the various Interval\* packages, they are not available to use unless I also add them individually:

```julia
(v1.0) pkg> add ValidatedNumerics
  Updating registry at `C:\Users\vdykb\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed FastRounding ────────────────── v0.2.0
 Installed SetRounding ─────────────────── v0.2.0
 Installed IntervalOptimisation ────────── v0.3.0
 Installed ValidatedNumerics ───────────── v0.11.0
 Installed IntervalConstraintProgramming ─ v0.9.0
 Installed IntervalContractors ─────────── v0.3.1
 Installed IntervalRootFinding ─────────── v0.4.0
 Installed IntervalArithmetic ──────────── v0.15.0
 Installed ErrorfreeArithmetic ─────────── v0.2.1
  Updating `C:\Users\vdykb\.julia\environments\v1.0\Project.toml`
  [d621b6e3] + ValidatedNumerics v0.11.0
  Updating `C:\Users\vdykb\.julia\environments\v1.0\Manifest.toml`
  [90fa49ef] + ErrorfreeArithmetic v0.2.1
  [fa42c844] + FastRounding v0.2.0
  [d1acc4aa] + IntervalArithmetic v0.15.0
  [138f1668] + IntervalConstraintProgramming v0.9.0
  [15111844] + IntervalContractors v0.3.1
  [c7c68f13] + IntervalOptimisation v0.3.0
  [d2bf35a9] + IntervalRootFinding v0.4.0
  [3cc68bcd] + SetRounding v0.2.0
  [d621b6e3] + ValidatedNumerics v0.11.0

julia> using IntervalArithmetic
ERROR: ArgumentError: Package IntervalArithmetic not found in current path:
- Run `import Pkg; Pkg.add("IntervalArithmetic")` to install the IntervalArithmetic package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:820

(v1.0) pkg> add IntervalArithmetic
 Resolving package versions...
  Updating `C:\Users\vdykb\.julia\environments\v1.0\Project.toml`
  [d1acc4aa] + IntervalArithmetic v0.15.0
  Updating `C:\Users\vdykb\.julia\environments\v1.0\Manifest.toml`
 [no changes]

julia> using IntervalArithmetic
[Info: Precompiling IntervalArithmetic [d1acc4aa-44c8-5952-acd4-ba5d80a2a253]

```

Is there a way, using the v1.0 package manager, to achieve the same result as under v0.6, i.e. install the metapackage and all of the constituent packages are available to use? Via a build script, perhaps?

In this example, simply `using ValidatedNumerics` would of course work, as the constituent packages are all re-exported. I was simply curious to know if there is a simple solution that allows not having all of the constituent packages loaded every time.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [November 5, 2018, 12:25pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/2 "2018-11-05T12:25:51Z")

</div>

Without `using` or equivalent, no installed package will be available in any given environment.

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 12:33pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/3 "2018-11-05T12:33:19Z")

</div>

I think you misunderstood, or I was not clear. The issue is that the packages cannot be _directly_ used, as shown in the example. Only the meta package can be used.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [November 5, 2018, 12:37pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/4 "2018-11-05T12:37:55Z")

</div>

> [@Sukera](#):
>
> Without `using` or equivalent, no installed package will be available in any given environment.

That’s incorrect. Add `BenchmarkTools` to your default environment (v1.0). Create an new empty environment somewhere (i.e. `] activate .` somewhere). Now try `using BenchmarkTools` in this empty environment: it will work.

However, at least when I started to use 1.0, I guess I would have liked environments to really be separated from each other.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 5, 2018, 12:40pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/5 "2018-11-05T12:40:19Z")

</div>

> [@braamvandyk](#):
>
> The issue is that the packages cannot be _directly_ used, as shown in the example. Only the meta package can be used.

This is intentional, you can only `using` what you have `add`ed. In Julia v0.6 this was not the case, but the fact that it worked can be considered a bug.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [November 5, 2018, 12:42pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/6 "2018-11-05T12:42:01Z")

</div>

> [@fredrikekre](#):
>
> This is intentional, you can only `using` what you have `add`ed.

Not quite, see my example above. I’d say you can only `using` what you `add`ed _somewhere._

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 12:42pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/7 "2018-11-05T12:42:33Z")

</div>

If you look at the example (you need to scroll) you will see that I add the metapackage (ValidatedNumerics) which installs the other packages and re-exports them. I can access the exported functions by using the metapackage, but you cannot use only one of the constituent packages unless you add that package individually, as was the case before.

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 12:44pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/8 "2018-11-05T12:44:45Z")

</div>

No doubt. This does however reduce the utility of a metapackage. I was wondering if that utility could somehow be recovered.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [November 5, 2018, 12:50pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/9 "2018-11-05T12:50:59Z")

</div>

I think you misunderstood. I meant `add`ing is not enough, you have to do `using` or equivalent as well to use a package installed via `add`. An installed package can of course be used from different environments, but they have to be used to be accessed.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 5, 2018, 12:53pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/10 "2018-11-05T12:53:23Z")

</div>

> [@carstenbauer](#):
>
> > This is intentional, you can only `using` what you have `add` ed.
> 
> Not quite, see my example above. I’d say you can only `using` what you `add` ed _somewhere._

Right, but then you have `add`ed it, just to an environment lower in the stack.

> [@braamvandyk](#):
>
> and re-exports them.

If this is the case you can

```julia
julia> using ValidatedNumerics

julia> using .IntervalContractors

```

where the `.` means that Julia should look for the module in the current module (`Main` in the Julia REPL) instead of loading it like a regular package (which, as you have seen, only work if the package is `add`ed).

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 12:57pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/11 "2018-11-05T12:57:33Z")

</div>

The only downside here is when I use the metapackage, all of constituent packages also get loaded. I was hoping to avoid this. Obviously the simple solution is to add them individually, which is no hardship. I was just being lazy.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 5, 2018, 12:59pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/12 "2018-11-05T12:59:16Z")

</div>

> [@braamvandyk](#):
>
> The only downside here is when I use the metapackage, all of constituent packages also get loaded. I was hoping to avoid this.

This has not changed since Julia v0.6.

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 1:04pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/13 "2018-11-05T13:04:05Z")

</div>

No it has not. But in v0.6 the constituent packages were available to use without adding them individually.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [November 5, 2018, 1:05pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/14 "2018-11-05T13:05:53Z")

</div>

> [@braamvandyk](#):
>
> But in v0.6 the constituent packages were available to use without adding them individually.

Right, and I suggested this, which works without explicitly adding the constituent package:

> [@fredrikekre](#):
>
> julia\> using ValidatedNumerics
> 
> julia\> using .IntervalContractors

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [November 5, 2018, 1:08pm UTC](https://discourse.julialang.org/t/question-regarding-metapackages-under-v1-0/17164/15 "2018-11-05T13:08:45Z")

</div>

I see. I missed that they need then not be added. Thanks!
