# Pkg can't load packages present in Manifest.toml?

**URL:** https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636
**Category:** General Usage
**Tags:** question
**Created:** [August 17, 2018, 6:49pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636 "2018-08-17T18:49:11Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![tlnagy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlnagy/32/5815_2.png) [@tlnagy](https://discourse.julialang.org/u/tlnagy)
#### Post date: [August 17, 2018, 6:49pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/1 "2018-08-17T18:49:11Z")

</div>

I was playing around with Julia 1.0 and noticed a weird behavior. Given I have an environment that looks like this

```julia
(v1.0) pkg> st
    Status `~/.julia/environments/v1.0/Project.toml`
  [a81c6b42] Compose v0.6.0+ [`~/.julia/dev/Compose`]
  [e30172f5] Documenter v0.19.5
  [c91e804a] Gadfly v0.7.0

(v1.0) pkg> st -m
    Status `~/.julia/environments/v1.0/Manifest.toml`
  ...
  ...
  [5ae59095] Colors v0.9.2
  ...
  ...

```

I find it surprising that I can’t load `Colors.jl`:

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

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:817

```

despite the fact that it’s in the Manifest and is explicitly required by `Compose.jl`. Instantiate and resolve don’t do anything either.

This came up when we load `Colors` inside the Compose docs. On Julia v0.6, it would load fine, but now I would have to explicitly install Colors despite it being required to be installed.

---

<div class="post-metadata">

### Author: ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)
#### Post date: [August 17, 2018, 7:48pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/2 "2018-08-17T19:48:07Z")

</div>

> [@tlnagy](#):
>
> I would have to explicitly install Colors despite it being required to be installed.

Yes, I’m pretty sure this is the intended behavior. For a given environment, you can only load packages which are explicitly declared for that environment.

---

<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: [August 17, 2018, 8:23pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/3 "2018-08-17T20:23:52Z")

</div>

Adding on to that, it may be that the package that has Colors.jl as a dependency is depending on a specific version of it. This version could conflict with a version needed by another package or even the environment directly, which is why dependencies of dependencies are not automatically available.

Edit: Only half true, see below.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [August 17, 2018, 8:43pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/4 "2018-08-17T20:43:13Z")

</div>

You can only have one version of a given package at a time. You can, however, have different packages with the same name in the overall dependency graph. It is intentional that you must explicitly declare your dependencies at the top level. These are connected facts since the top-level `Colors` could be totally unrelated to an indirect `Colors` dependency.

---

<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: [August 17, 2018, 8:47pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/5 "2018-08-17T20:47:24Z")

</div>

> You can only have one version of a given package at a time.

So the following would not be possible? Say package A depends on version 0.1 of package B, I am developing package with a dependency on version 0.2 of package B and a dependency on package A. In this scenario, package C would both directly and indirectly depend on two different versions of package B respectively.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [August 17, 2018, 8:48pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/6 "2018-08-17T20:48:47Z")

</div>

Correct, that is not possible. It is quite rare for Julia packages to depend on a specific version of a dependency.

---

<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: [August 17, 2018, 8:50pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/7 "2018-08-17T20:50:36Z")

</div>

Hmm, that seems unfortunate, though I must admit it also seems a bit contrived as an example. What would be a good workaround should this situation show up?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [August 17, 2018, 8:52pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/8 "2018-08-17T20:52:23Z")

</div>

Fix A, B or your own package so that there is a common version of A that works with both.

---

<div class="post-metadata">

### Author: ![tlnagy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlnagy/32/5815_2.png) [@tlnagy](https://discourse.julialang.org/u/tlnagy)
#### Post date: [August 17, 2018, 9:00pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/9 "2018-08-17T21:00:43Z")

</div>

> [@StefanKarpinski](#):
>
> It is intentional that you must explicitly declare your dependencies at the top level.

So this is a change from how things were done in the previous package manager, right? So now, even though `Compose` requires `Colors`, you need to also `Pkg.add("Colors")` to explicitly list it in the `Project.toml`

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [August 17, 2018, 9:02pm UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/10 "2018-08-17T21:02:08Z")

</div>

Yes, precisely. It’s actually deeper than the package manager and is baked into how code loading itself works.

---

<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: [August 18, 2018, 7:12am UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/11 "2018-08-18T07:12:44Z")

</div>

In an emergency I guess you could make a fork of B with a different UUID and specify different versions for B and B’.

---

<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: [August 18, 2018, 11:08am UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636/12 "2018-08-18T11:08:08Z")

</div>

A fork wouldn’t even be necessary - if you’re going to fix the package anyway, you can just as well use the local branch temporarily and make a PR. After it’s merged, you can track the original package again.
