Error: Failed to precompile IJulia v1.24.0

I have been trying to run a particular jupyter notebook using IJulia but I get an error. A few things to note:

[ Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]
ERROR: LoadError: ArgumentError: Package Parsers 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 Parsers 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 Parsers
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(mod::Module, _path::String)
   @ Base .\Base.jl:419
 [5] include(x::String)
   @ Parsers C:\Users\Jaydev Singh Rao\.julia\packages\Parsers\ZbMpq\src\Parsers.jl:1
 [6] top-level scope
   @ C:\Users\Jaydev Singh Rao\.julia\packages\Parsers\ZbMpq\src\Parsers.jl:428
 [7] include
   @ .\Base.jl:419 [inlined]
 [8] 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
 [9] top-level scope
   @ stdin:1
in expression starting at C:\Users\Jaydev Singh Rao\.julia\packages\Parsers\ZbMpq\src\precompile.jl:1
in expression starting at C:\Users\Jaydev Singh Rao\.julia\packages\Parsers\ZbMpq\src\Parsers.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Parsers [69de0a69-1ddd-5017-9359-2bf0b02dc9f0] to C:\Users\Jaydev Singh Rao\.julia\compiled\v1.8\Parsers\jl_491C.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:1707
  [3] compilecache
    @ .\loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
  [6] macro expansion
    @ .\loading.jl:1180 [inlined]
  [7] macro expansion
    @ .\lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1144
  [9] include(mod::Module, _path::String)
    @ Base .\Base.jl:419
 [10] include(x::String)
    @ JSON C:\Users\Jaydev Singh Rao\.julia\packages\JSON\NeJ9k\src\JSON.jl:3
 [11] top-level scope
    @ C:\Users\Jaydev Singh Rao\.julia\packages\JSON\NeJ9k\src\JSON.jl:11
 [12] include
    @ .\Base.jl:419 [inlined]
 [13] 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
 [14] top-level scope
    @ stdin:1
in expression starting at C:\Users\Jaydev Singh Rao\.julia\packages\JSON\NeJ9k\src\Parser.jl:1
in expression starting at C:\Users\Jaydev Singh Rao\.julia\packages\JSON\NeJ9k\src\JSON.jl:3
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6] to C:\Users\Jaydev Singh Rao\.julia\compiled\v1.8\JSON\jl_43BD.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:1707
  [3] compilecache
    @ .\loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
  [6] macro expansion
    @ .\loading.jl:1180 [inlined]
  [7] macro expansion
    @ .\lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1144
  [9] include
    @ .\Base.jl:419 [inlined]
 [10] 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
 [11] top-level scope
    @ stdin:1
in expression starting at C:\Users\Jaydev Singh Rao\.julia\packages\IJulia\6TIq1\src\IJulia.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] to C:\Users\Jaydev Singh Rao\.julia\compiled\v1.8\IJulia\jl_40EE.tmp.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base .\loading.jl:1707
 [3] compilecache
   @ .\loading.jl:1651 [inlined]
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1337
 [5] _require_prelocked(uuidkey::Base.PkgId)
   @ Base .\loading.jl:1200
 [6] macro expansion
   @ .\loading.jl:1180 [inlined]
 [7] macro expansion
   @ .\lock.jl:223 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1144
in expression starting at C:\Users\Jaydev Singh Rao\.julia\packages\IJulia\6TIq1\src\kernel.jl:1
  • Version information
(v1.8) julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores

Things I tried:

  1. Pkg.instantiate and Pkg.resolve
  2. Reinstall jupyter
  3. Reinstall IJulia
  4. Rebuild IJulia several times
  5. Reinstall Anaconda
  6. Update julia version from v1.8.4 to v1.8.5

None of these have worked for me.

Pkg.resolve() in the appropriate environment should have done the trick for you. But if IJulia is in your default environment, and you were in a different package- or project-specific environment when you resolved, then you need to re-resolve your default environment.

Consider Pkg.update() if that doesn’t work.

2 Likes

Yes you’re right! I was not instantiating and resolving the appropriate environment. Thanks a lot!