`using JuMP` reports an ERROR

It reports an ERROR when I using JuMP (version: JuMP v1.20.0):

[ Info: Precompiling JuMP [4076af6c-e467-56ae-b986-b466b2749572]
ERROR: LoadError: ArgumentError: Package JuMP does not have SnoopPrecompile 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 JuMP checked out for development and have
  added SnoopPrecompile 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 JuMP
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1599 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1576
 [4] include
   @ .\Base.jl:457 [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, UInt128}}, source::String)
   @ Base .\loading.jl:2010
 [6] top-level scope
   @ stdin:2
in expression starting at C:\Users\Name\.julia\packages\JuMP\ptoff\src\JuMP.jl:11
in expression starting at stdin:2

I suppose not the first nor the second caveat apply?

Did you try:

mkdir MyProject
cd MyProject
julia --project="."

and then at the Julia prompt:

using Pkg
Pkg.add("JuMP")

?

Well, I ran using JuMP again and it worked. Thanks to everyone!

2 Likes

JuMP v1.20.0 does not use SnoopPrecompile, so I assume that you had something weird going on with your environment (i.e., it was probably the first bullet point).

1 Like