# Julia 1.8: ChainRules does not have Adapt in its dependencies

**URL:** <https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474>\
**Category:** General Usage\
**Tags:** question, package, chainrules\
**Created:** [August 28, 2022, 10:57pm UTC](https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474 "2022-08-28T22:57:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xavier\_Gonzalez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavier_gonzalez/32/36033_2.png) [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Post date:** [August 28, 2022, 10:57pm UTC](https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474/1 "2022-08-28T22:57:41Z")

</div>

I’m working on a codebase I’ve inherited. It runs completely fine in Julia 1.7

However, if I run identical code in Julia 1.8, I get the following error message

```julia
ERROR: LoadError: ArgumentError: Package ChainRules does not have Adapt in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have ChainRules checked out for development and have
  added Adapt as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with ChainRules
Stacktrace:
 [1] macro expansion
   @ ./loading.jl:1167 [inlined]
 [2] macro expansion
   @ ./lock.jl:223 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1144
 [4] include
   @ ./Base.jl:419 [inlined]
 [5] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1554
 [6] top-level scope
   @ stdin:1
in expression starting at /Users/user/.julia/packages/ChainRules/kZnzE/src/ChainRules.jl:1
in expression starting at stdin:1

```

I’m not finding anything super helpful online (I think because version 1.8 just came out), and so any pointers in the right direction would be very appreciated!

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [August 28, 2022, 11:02pm UTC](https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474/2 "2022-08-28T23:02:27Z")

</div>

Can you share the output of `Pkg.status()`?  
( And just to be sure, did you run `Pkg.instantiate()`? )

---

<div class="post-metadata">

**Author:** ![Xavier\_Gonzalez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavier_gonzalez/32/36033_2.png) [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Post date:** [August 29, 2022, 5:09pm UTC](https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474/3 "2022-08-29T17:09:12Z")

</div>

I have tried the recommendations given to me by the error message (e.g. `Pkg.instantiate()`) but I’m getting the same error.

Here is the output of `Pkg.status()`

```julia
Status `~/.julia/environments/v1.8/Project.toml`
  [587475ba] Flux v0.13.5
⌃ [c3e4b0f8] Pluto v0.19.4
Info Packages marked with ⌃ have new versions available

```

---

<div class="post-metadata">

**Author:** ![Xavier\_Gonzalez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xavier_gonzalez/32/36033_2.png) [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Post date:** [August 29, 2022, 10:38pm UTC](https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474/4 "2022-08-29T22:38:29Z")

</div>

OK, apparently what I needed to update was the `dev` environment.

But what exactly is this environment?

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [August 30, 2022, 2:57pm UTC](https://discourse.julialang.org/t/julia-1-8-chainrules-does-not-have-adapt-in-its-dependencies/86474/5 "2022-08-30T14:57:21Z")

</div>

The `dev` environment is a local copy of a package, which allows you to change the package locally for yourself. [3. Managing Packages · Pkg.jl](https://pkgdocs.julialang.org/v1/managing-packages/#developing)  
Normally you should not need to use a `dev` environment if you are just using packages.  
There is the `pkg> free PackageName` command to use the registered version again.

Does the project have a `Project.toml` file? It looks like you are working in the global environment (`@v1.8`). Maybe what was missing was to activate the project environment (i.e. in package mode, call `pkg> activate .`)

By the way, there was recently this post with a nice detailed tutorial on `Pkg`: [jkrumbiegel.com - Pkg.jl and Julia Environments for Beginners](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/)
