JuliaPlots / StatsPlots.jl

Statistical plotting recipes for Plots.jl
Other
436 stars 88 forks source link

Arpack error when trying to use "using StatsPlots" command in a Jupyter Notebook #505

Closed sreedta8 closed 2 years ago

sreedta8 commented 2 years ago

Hi

I'm a new Julia user on an Ubuntu machine with OS version 21.04 with julia version-1.7.3. When using Pkg.add("StatsPlots") or try julia> using StatsPlots there are no errors for Arpack / Arpack_jll / MultivariateStats / StatsPlots. When I try using StatsPlots in a Jupyter notebook, I get the following error(s). Any help to overcome this will be very helpful. I have been dealing with this error for 2 days.

Info: Precompiling StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd]
└ @ Base loading.jl:1423
ERROR: LoadError: InitError: Artifact "Arpack" was not installed correctly. Try `using Pkg; Pkg.instantiate()` to re-install all missing resources.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] _artifact_str(__module__::Module, artifacts_toml::String, name::SubString{String}, path_tail::String, artifact_dict::Dict{String, Any}, hash::Base.SHA1, platform::Base.BinaryPlatforms.Platform, lazyartifacts::Any)
    @ Artifacts ~/julia-1.7.2/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:551
  [3] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./essentials.jl:716
  [4] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:714
  [5] macro expansion
    @ ~/julia-1.7.2/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:680 [inlined]
  [6] find_artifact_dir()
    @ Arpack_jll ~/.julia/packages/JLLWrappers/QpMQW/src/wrapper_generators.jl:17
  [7] __init__()
    @ Arpack_jll ~/.julia/packages/Arpack_jll/zfgpQ/src/wrappers/x86_64-linux-gnu-libgfortran5.jl:9
  [8] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:768
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:854
 [10] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1097
 [11] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
 [13] include
    @ ./Base.jl:418 [inlined]
 [14] 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
 [15] top-level scope
    @ none:1
 [16] eval
    @ ./boot.jl:373 [inlined]
 [17] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [18] top-level scope
    @ none:1
during initialization of module Arpack_jll
in expression starting at /home/sreedta/.julia/packages/Arpack/pLziT/src/Arpack.jl:2
ERROR: LoadError: Failed to precompile Arpack [7d9fca2a-8960-54d3-9f78-7d1dccf2cb97] to /home/sreedta/.julia/compiled/v1.7/Arpack/jl_1tKEUY.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1466
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1410
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1120
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
  [7] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [8] include(x::String)
    @ MultivariateStats ~/.julia/packages/MultivariateStats/cFZlL/src/MultivariateStats.jl:1
  [9] top-level scope
    @ ~/.julia/packages/MultivariateStats/cFZlL/src/MultivariateStats.jl:116
 [10] include
    @ ./Base.jl:418 [inlined]
 [11] 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
 [12] top-level scope
    @ none:1
 [13] eval
    @ ./boot.jl:373 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [15] top-level scope
    @ none:1
in expression starting at /home/sreedta/.julia/packages/MultivariateStats/cFZlL/src/kpca.jl:3
in expression starting at /home/sreedta/.julia/packages/MultivariateStats/cFZlL/src/MultivariateStats.jl:1
ERROR: LoadError: Failed to precompile MultivariateStats [6f286f6a-111f-5878-ab1e-185364afe411] to /home/sreedta/.julia/compiled/v1.7/MultivariateStats/jl_t8s7rf.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1466
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1410
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1120
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
  [7] include
    @ ./Base.jl:418 [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::Nothing)
    @ Base ./loading.jl:1318
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:373 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [12] top-level scope
    @ none:1
in expression starting at /home/sreedta/.julia/packages/StatsPlots/8DjQs/src/StatsPlots.jl:1
Failed to precompile StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd] to /home/sreedta/.julia/compiled/v1.7/StatsPlots/jl_2vmNzu.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997
 [7] eval
   @ ./boot.jl:373 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1196 ```

Here is the output from my ```Pkg.status()``` command:

julia> Pkg.status() Status ~/.julia/environments/v1.7/Project.toml [7d9fca2a] Arpack v0.5.3 [30b0a656] ArrayInterfaceCore v0.1.13 [131c737c] ArviZ v0.5.22 [336ed68f] CSV v0.10.4 [a93c6f00] DataFrames v1.3.4 [864edb3b] DataStructures v0.18.13 [0c46a032] DifferentialEquations v7.1.0 [b4f34e82] Distances v0.10.7 [31c24e10] Distributions v0.25.63 [634d3b9d] DrWatson v2.9.1 [587475ba] Flux v0.13.3 [38e38edf] GLM v1.8.0 [e9467ef8] GLMakie v0.6.8 [c91e804a] Gadfly v1.3.4 [cd3eb016] HTTP v0.9.17 [7073ff75] IJulia v1.23.3 [4076af6c] JuMP v1.1.1 [c7f686f2] MCMCChains v5.3.1 [f0e99cf1] MLBase v0.9.0 [cc2ba9b6] MLDataUtils v0.5.4 [ee78f7c6] Makie v0.17.8 [6fafb56a] Memoization v0.1.14 [dbeba491] Metalhead v0.7.3 [ff71e718] MixedModels v4.6.4 [6f286f6a] MultivariateStats v0.9.1 [872c559c] NNlib v0.8.8 [a15396b6] OnlineStats v1.5.13 [3bd65402] Optimisers v0.2.7 [8314cec4] PGFPlotsX v1.5.0 [91a5bcdd] Plots v1.31.1 [c3e4b0f8] Pluto v0.19.9 [d330b81b] PyPlot v2.10.0 [6f49c342] RCall v0.13.13 [ce6b1742] RDatasets v0.7.7 [37e2e3b7] ReverseDiff v1.14.1 [0bca4576] SciMLBase v1.42.1 [3646fa90] ScikitLearn v0.6.4 [2913bbd2] StatsBase v0.33.18 [3eaba693] StatsModels v0.6.30 [f3b207a7] StatsPlots v0.14.34 [9672c7b4] SteadyStateDiffEq v1.8.0 [fce5fe82] Turing v0.21.7 [0004c1f4] TuringGLM v2.0.1 [b8865327] UnicodePlots v3.0.3 [112f6efa] VegaLite v2.6.0 [e88e6eb3] Zygote v0.6.40 [68821587] Arpack_jll v3.5.1+1 [10745b16] Statistics ```

sreedta8 commented 2 years ago

For what it is worth, I created a new project and installed only DataFrames.jl, Plots.jl, and StatsPlots.jl - I could test basic charts such as a Scatter plot or a Histogram without any problems. All of the Arpack related errors were gone. So the original error, I have reported above must be the result of clash between requirements of one or more of the additional packages I installed. I would have expected that Pkg package manager, would manage the requirements checking process as Conda does in Anaconda

As a new user of Julia, these type of errors are very frustrating. I will continue working trough these errors.