Precompiling Flux

I am working on the Mac with Julia 1.8.2 in Visual Code. I installed Flux, but when adding it via the package manager using \ followed by add, I get the following error:

ERROR: LoadError: UndefVarError: IndicesInfo not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/ArrayInterface/eITVf/src/dimensions.jl:4
in expression starting at /Users/erlebach/.julia/packages/ArrayInterface/eITVf/src/dimensions.jl:4
in expression starting at /Users/erlebach/.julia/packages/ArrayInterface/eITVf/src/ArrayInterface.jl:1
in expression starting at /Users/erlebach/.julia/packages/Flux/nJ0IB/src/optimise/Optimise.jl:1
in expression starting at /Users/erlebach/.julia/packages/Flux/nJ0IB/src/Flux.jl:1

Below, I listed the full output from the add Flux statement, followed by the Project.toml file and the Flux section from Manifest.toml.
Any insight is greatly appreciated.

(amplitude_encode) pkg> add Flux
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
   Installed Accessors ─── v0.1.21
   Installed GPUCompiler ─ v0.16.5
   Installed NNlib ─────── v0.8.10
   Installed Flux ──────── v0.13.7
    Updating `~/src/2022/Quantum_Neural_Network_Classifiers/amplitude_encode/Project.toml`
  [587475ba] + Flux v0.13.7
    Updating `~/src/2022/Quantum_Neural_Network_Classifiers/amplitude_encode/Manifest.toml`
  [7d9f7c33] + Accessors v0.1.21
  [dce04be8] + ArgCheck v2.3.0
  [4fba245c] + ArrayInterface v6.0.23
  [ab4f0b2a] + BFloat16s v0.2.0
  [198e06fe] + BangBang v0.3.37
  [9718e550] + Baselet v0.1.1
  [052768ef] + CUDA v3.12.0
  [a33af91c] + CompositionsBase v0.1.1
  [187b0558] + ConstructionBase v1.4.1
  [6add18c4] + ContextVariablesX v0.1.3
  [244e2a9f] + DefineSingletons v0.1.2
  [e2ba6199] + ExprTools v0.1.8
  [cc61a311] + FLoops v0.2.1
  [b9860ae5] + FLoopsBase v0.1.1
  [587475ba] + Flux v0.13.7
  [9c68100b] + FoldsThreads v0.1.1
  [069b7b12] + FunctionWrappers v1.1.3
  [d9f16b24] + Functors v0.3.0
  [61eb1bfa] + GPUCompiler v0.16.5
  [615f187c] + IfElse v0.1.1
  [22cec73e] + InitialValues v0.3.1
  [b14d175d] + JuliaVariables v0.2.4
  [f1d291b0] + MLUtils v0.2.11
  [128add7d] + MicroCollections v0.1.3
  [872c559c] + NNlib v0.8.10
  [a00861dc] + NNlibCUDA v0.2.4
  [71a1bf82] + NameResolution v0.1.5
  [0b1bfda6] + OneHotArrays v0.1.0
  [3bd65402] + Optimisers v0.2.10
  [8162dcfd] + PrettyPrint v0.2.0
  [33c8b6b6] + ProgressLogging v0.1.4
  [74087812] + Random123 v1.6.0
  [e6cf234a] + RandomNumbers v1.5.3
  [efcf1570] + Setfield v1.1.1
  [605ecd9f] + ShowCases v0.1.0
  [171d559e] + SplittablesBase v0.1.15
  [aedffcd0] + Static v0.7.7
  [a759f4b9] + TimerOutputs v0.5.21
  [28d57a85] + Transducers v0.4.74
  [0dad84c5] ~ ArgTools v1.1.1 ⇒ 
  [f43a241f] ~ Downloads v1.6.0 ⇒ 
  [7b1f6079] - FileWatching
  [9fa8497b] + Future
  [b27032c2] ~ LibCURL v0.6.3 ⇒ 
  [ca575930] ~ NetworkOptions v1.2.0 ⇒ 
  [44cfe95a] ~ Pkg v1.8.0 ⇒ 
  [ea8e919c] ~ SHA v0.7.0 ⇒ 
  [fa267f1f] ~ TOML v1.0.0 ⇒ 
  [a4e569a6] ~ Tar v1.10.1 ⇒ 
  [e66e0078] ~ CompilerSupportLibraries_jll v0.5.2+0 ⇒ 
  [deac9b47] ~ LibCURL_jll v7.84.0+0 ⇒ 
  [29816b5a] ~ LibSSH2_jll v1.10.2+0 ⇒ 
  [c8ffd9c3] ~ MbedTLS_jll v2.28.0+0 ⇒ 
  [14a3606d] ~ MozillaCACerts_jll v2022.2.1 ⇒ 
  [4536629a] ~ OpenBLAS_jll v0.3.20+0 ⇒ 
  [05823500] ~ OpenLibm_jll v0.8.1+0 ⇒ 
  [efcefdf7] ~ PCRE2_jll v10.40.0+0 ⇒ 
  [83775a58] ~ Zlib_jll v1.2.12+3 ⇒ 
  [8e850b90] ~ libblastrampoline_jll v5.1.1+0 ⇒ 
  [8e850ede] ~ nghttp2_jll v1.48.0+0 ⇒ 
  [3f19e933] ~ p7zip_jll v17.4.0+0 ⇒ 
Precompiling project...
  9 dependencies successfully precompiled in 37 seconds (234 already precompiled, 1 skipped during auto due to previous errors)

[ Info: Precompiling Flux [587475ba-b771-5e3f-ad9e-33799f191a9c]
┌ Warning: Module ArrayInterfaceCore with build ID 944578982755209 is missing from the cache.
│ This may mean ArrayInterfaceCore [30b0a656-2188-435a-8636-2ec0e6a096e2] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1107
┌ Warning: Module ArrayInterfaceCore with build ID 944578982755209 is missing from the cache.
│ This may mean ArrayInterfaceCore [30b0a656-2188-435a-8636-2ec0e6a096e2] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1107
[ Info: Skipping precompilation since __precompile__(false). Importing Flux [587475ba-b771-5e3f-ad9e-33799f191a9c].
[ Info: Precompiling ArrayInterface [4fba245c-0d91-5ea0-9b3e-6abc04ee57a9]
┌ Warning: Module ArrayInterfaceCore with build ID 944578982755209 is missing from the cache.
│ This may mean ArrayInterfaceCore [30b0a656-2188-435a-8636-2ec0e6a096e2] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1107
[ Info: Skipping precompilation since __precompile__(false). Importing ArrayInterface [4fba245c-0d91-5ea0-9b3e-6abc04ee57a9].
WARNING: could not import ArrayInterfaceCore.ndims_shape into ArrayInterface
WARNING: could not import ArrayInterfaceCore.is_forwarding_wrapper into ArrayInterface
WARNING: could not import ArrayInterfaceCore.IndicesInfo into ArrayInterface
WARNING: could not import ArrayInterfaceCore.childdims into ArrayInterface
WARNING: could not import ArrayInterfaceCore.parentdims into ArrayInterface
WARNING: could not import ArrayInterfaceCore.map_tuple_type into ArrayInterface
WARNING: could not import ArrayInterfaceCore.flatten_tuples into ArrayInterface
WARNING: could not import ArrayInterfaceCore.GetIndex into ArrayInterface
WARNING: could not import ArrayInterfaceCore.SetIndex! into ArrayInterface
WARNING: could not import ArrayInterfaceCore.defines_strides into ArrayInterface
WARNING: could not import ArrayInterfaceCore.stride_preserving_index into ArrayInterface
WARNING: could not import ArrayInterfaceCore.device into ArrayInterface
ERROR: LoadError: UndefVarError: IndicesInfo not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/ArrayInterface/eITVf/src/dimensions.jl:4
in expression starting at /Users/erlebach/.julia/packages/ArrayInterface/eITVf/src/dimensions.jl:4
in expression starting at /Users/erlebach/.julia/packages/ArrayInterface/eITVf/src/ArrayInterface.jl:1
in expression starting at /Users/erlebach/.julia/packages/Flux/nJ0IB/src/optimise/Optimise.jl:1
in expression starting at /Users/erlebach/.julia/packages/Flux/nJ0IB/src/Flux.jl:1

My Pproject.toml is listed below:

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Yao = "5872b779-8223-5990-8dd0-5abbb0748c8c"
YaoPlots = "32cfe2d9-419e-45f2-8191-2267705d8dbc"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

The Flux section of the manifest:

[[deps.Flux]]
deps = ["Adapt", "ArrayInterface", "CUDA", "ChainRulesCore", "Functors", "LinearAlgebra", "MLUtils", "MacroTools", "NNlib", "NNlibCUDA", "OneHotArrays", "Optimisers", "ProgressLogging", "Random", "Reexport", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "Test", "Zygote"]
git-tree-sha1 = "66b62bf72c4b5d4904441ed0677eab53266033c7"
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
version = "0.13.7"

I can instantiate from your Project.toml, with Julia 1.8.2, and load Flux.

Does this happen on a clean session, for you?

The errors look a bit like something already loaded an older (or newer?) version of ArrayInterfaceCore in the same session. These packages have complicated version bounds.

After executing update in pkg, I added Flux with no error. But then when using Flux, I again get the error (I show a small section below):

ulia> using Flux
[ Info: Precompiling Flux [587475ba-b771-5e3f-ad9e-33799f191a9c]
WARNING: could not import ArrayInterfaceCore.ndims_shape into ArrayInterface
WARNING: could not import ArrayInterfaceCore.is_forwarding_wrapper into ArrayInterface
WARNING: could not import ArrayInterfaceCore.IndicesInfo into ArrayInterface
WARNING: could not import ArrayInterfaceCore.childdims into ArrayInterface
WARNING: could not import ArrayInterfaceCore.parentdims into ArrayInterface
WARNING: could not import ArrayInterfaceCore.map_tuple_type into ArrayInterface
WARNING: could not import ArrayInterfaceCore.flatten_tuples into ArrayInterface
WARNING: could not import ArrayInterfaceCore.GetIndex into ArrayInterface
WARNING: could not import ArrayInterfaceCore.SetIndex! into ArrayInterface
WARNING: could not import ArrayInterfaceCore.defines_strides into ArrayInterface
WARNING: could not import ArrayInterfaceCore.stride_preserving_index into ArrayInterface
WARNING: could not import ArrayInterfaceCore.device into ArrayInterface
ERROR: LoadError: UndefVarError: IndicesInfo not defined
Stacktrace:
  [1] top-level scope
    @ ~/.julia/packages/ArrayInterface/eITVf/src/dimensions.jl:4
  [2] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [3] include(x::String)
    @ ArrayInterface ~/.julia/packages/ArrayInterface/eITVf/src/ArrayInterface.jl:1
  [4] top-level scope
    @ ~/.julia/packages/ArrayInterface/eITVf/src/ArrayInterface.jl:262
  [5] include
    @ ./Base.jl:418 [inlined]
  [6] 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:1318
  [7] top-level scope
    @ none:1
  [8] eval
    @ ./boot.jl:373 [inlined]
  [9] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [10] top-level scope
    @ none:1

I figured out the problem. I forgot to set the environment in the Julia window. It is unfortunate that it must be set in the REPL and the Julia window separately. Cheers!

Gordon