JuliaPlots / StatsPlots.jl

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

Cannot precompile (Method Error) #488

Closed wizofe closed 2 years ago

wizofe commented 2 years ago

When I am trying to use/precompile the package I am getting errors. I am on Mac OS Big Sur (11.6.4) using the default zsh and Julia 1.7.2.

Here's the first:

julia> Pkg.precompile("StatsPlots")
ERROR: MethodError: no method matching precompile(::String)
Closest candidates are:
  precompile(; kwargs...) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011
  precompile(::Pkg.Types.Context; internal_call, strict, warn_loaded, already_instantiated, kwargs...) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:1012
Stacktrace:
 [1] top-level scope

When trying to use the package I get the following error:

julia> using StatsPlots
[ Info: Precompiling StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd]
ERROR: LoadError: UndefVarError: pairwise! not defined
Stacktrace:
 [1] include
   @ ./Base.jl:418 [inlined]
 [2] 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
 [3] top-level scope
   @ none:1
 [4] eval
   @ ./boot.jl:373 [inlined]
 [5] eval(x::Expr)
   @ Base.MainInclude ./client.jl:453
 [6] top-level scope
   @ none:1
in expression starting at /Users/wizofe/.julia/packages/MultivariateStats/zLpz8/src/MultivariateStats.jl:1
ERROR: LoadError: Failed to precompile MultivariateStats [6f286f6a-111f-5878-ab1e-185364afe411] to /Users/wizofe/.julia/compiled/v1.7/MultivariateStats/jl_KXcnvB.
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 /Users/wizofe/.julia/packages/StatsPlots/CpWiU/src/StatsPlots.jl:1
ERROR: Failed to precompile StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd] to /Users/wizofe/.julia/compiled/v1.7/StatsPlots/jl_FChLTR.
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
sethaxen commented 2 years ago

Here's the first:

julia> Pkg.precompile("StatsPlots")
ERROR: MethodError: no method matching precompile(::String)
Closest candidates are:
  precompile(; kwargs...) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011
  precompile(::Pkg.Types.Context; internal_call, strict, warn_loaded, already_instantiated, kwargs...) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/Pkg/src/API.jl:1012
Stacktrace:
 [1] top-level scope

As noted by the error, this is not a valid method for Pkg.precompile.

julia> using Pkg

help?> Pkg.precompile
  Pkg.precompile(; strict::Bool=false)

  Precompile all the dependencies of the project in parallel.
...

When trying to use the package I get the following error:

I was not able to replicate this in a clean environment on Julia 1.7.2. Have you tried this in a clean environment? If it still errors, can you share your versioninfo() and using Pkg; Pkg.status() outputs?

wizofe commented 2 years ago
julia> Pkg.status()
      Status `~/.julia/environments/v1.7/Project.toml`
  [6e4b80f9] BenchmarkTools v1.2.2
  [e1450e63] BufferedStreams v1.0.0
  [336ed68f] CSV v0.8.5
  [159f3aea] Cairo v1.0.5
  [35d6a980] ColorSchemes v3.16.0
  [717857b8] DSP v0.7.4
  [a93c6f00] DataFrames v0.22.7
  [1313f7d8] DataFramesMeta v0.8.0
  [31c24e10] Distributions v0.23.8
  [c91e804a] Gadfly v1.3.4
  [c27321d9] Glob v1.3.0
  [09f84164] HypothesisTests v0.10.6
  [a3a9e032] NIfTI v0.5.6
  [9b87118b] PackageCompiler v2.0.4
  [91a5bcdd] Plots v1.0.14
  [c3e4b0f8] Pluto v0.18.0
  [ba7d4641] Recombinase v0.1.1
  [2913bbd2] StatsBase v0.32.2
  [f3b207a7] StatsPlots v0.14.33
  [44d3d7a6] Weave v0.10.10
julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, haswell)
BeastyBlacksmith commented 2 years ago

Thats a fairly old version of Plots you got there Try pkg> add Plots@1.25.0 (or the current version) to see which Package is holding you back. However, we should think about rasing the lower bound for Plots in StatsPlots.

sethaxen commented 2 years ago

This seems to be unrelated to StatsPlots. Note that StatsPlots can't precompile because MultivariateStats can't. I was able to reproduce this issue with the same packages as you have in your environment. I found that if I just removed Recombinase, the precompilation issue went away. Moreover, if I created a clean environment with just MultivariateStats, it loaded just fine, but if I added Recombinase, then it wouldn't load. I would advise opening an issue on either MultivariateStats or Recombinase.

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.2 (2022-02-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.7) pkg> activate --temp
  Activating new project at `/tmp/jl_Tlqq8v`

(jl_Tlqq8v) pkg> add MultivariateStats
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/tmp/jl_Tlqq8v/Project.toml`
  [6f286f6a] + MultivariateStats v0.9.0
    Updating `/tmp/jl_Tlqq8v/Manifest.toml`
  [7d9fca2a] + Arpack v0.5.3
  [d360d2e6] + ChainRulesCore v1.12.0
  [9e997f8a] + ChangesOfVariables v0.1.2
  [34da2185] + Compat v3.41.0
  [9a962f9c] + DataAPI v1.9.0
  [864edb3b] + DataStructures v0.18.11
  [ffbed154] + DocStringExtensions v0.8.6
  [3587e190] + InverseFunctions v0.1.2
  [92d709cd] + IrrationalConstants v0.1.1
  [692b3bcd] + JLLWrappers v1.4.1
  [2ab3a3ac] + LogExpFunctions v0.3.6
  [e1d29d7a] + Missings v1.0.2
  [6f286f6a] + MultivariateStats v0.9.0
  [bac558e1] + OrderedCollections v1.4.1
  [21216c6a] + Preferences v1.2.3
  [a2af1166] + SortingAlgorithms v1.0.1
  [82ae8749] + StatsAPI v1.2.0
  [2913bbd2] + StatsBase v0.33.14
  [68821587] + Arpack_jll v3.5.1+1
  [0dad84c5] + ArgTools
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [f43a241f] + Downloads
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [fa267f1f] + TOML
  [a4e569a6] + Tar
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll
  [deac9b47] + LibCURL_jll
  [29816b5a] + LibSSH2_jll
  [c8ffd9c3] + MbedTLS_jll
  [14a3606d] + MozillaCACerts_jll
  [4536629a] + OpenBLAS_jll
  [83775a58] + Zlib_jll
  [8e850b90] + libblastrampoline_jll
  [8e850ede] + nghttp2_jll
  [3f19e933] + p7zip_jll

julia> using MultivariateStats
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.2 (2022-02-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.7) pkg> activate --temp
a  Activating new project at `/tmp/jl_cYvfGG`

(jl_cYvfGG) pkg> add MultivariateStats, Recombinase
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/tmp/jl_cYvfGG/Project.toml`
  [6f286f6a] + MultivariateStats v0.9.0
  [ba7d4641] + Recombinase v0.1.1
    Updating `/tmp/jl_cYvfGG/Manifest.toml`
  [621f4979] + AbstractFFTs v1.1.0
  [1520ce14] + AbstractTrees v0.3.4
  [79e6a3ab] + Adapt v3.3.3
  [7d9fca2a] + Arpack v0.5.0
  [13072b0f] + AxisAlgorithms v1.0.1
  [49dc2e85] + Calculus v0.5.1
  [d360d2e6] + ChainRulesCore v1.12.0
  [9e997f8a] + ChangesOfVariables v0.1.2
  [3da002f7] + ColorTypes v0.9.1
  [5ae59095] + Colors v0.11.2
  [bbf7d656] + CommonSubexpressions v0.3.0
  [34da2185] + Compat v3.41.0
  [9a962f9c] + DataAPI v1.9.0
  [864edb3b] + DataStructures v0.17.20
  [e2d170a0] + DataValueInterfaces v1.0.0
  [e7dc6d0d] + DataValues v0.4.13
  [01453d9d] + DiffEqDiffTools v0.14.0
  [163ba53b] + DiffResults v1.0.3
  [b552c78f] + DiffRules v1.9.1
  [b4f34e82] + Distances v0.10.7
  [31c24e10] + Distributions v0.23.8
  [ffbed154] + DocStringExtensions v0.8.6
  [7a1cc6ca] + FFTW v1.4.5
  [1a297f60] + FillArrays v0.8.14
  [53c48c17] + FixedPointNumbers v0.7.1
  [f6369f11] + ForwardDiff v0.10.25
  [6deec6e2] + IndexedTables v0.12.6
  [a98d9a8b] + Interpolations v0.12.10
  [3587e190] + InverseFunctions v0.1.2
  [92d709cd] + IrrationalConstants v0.1.1
  [c8e1da08] + IterTools v1.4.0
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.4.1
  [5ab0869b] + KernelDensity v0.5.1
  [d3d80556] + LineSearches v7.1.1
  [4345ca2d] + Loess v0.5.4
  [2ab3a3ac] + LogExpFunctions v0.3.6
  [1914dd2f] + MacroTools v0.5.9
  [e1d29d7a] + Missings v0.4.5
  [6f286f6a] + MultivariateStats v0.9.0
  [d41bc354] + NLSolversBase v7.5.0
  [77ba4419] + NaNMath v0.3.7
  [510215fc] + Observables v0.3.3
  [6fe1bfb0] + OffsetArrays v1.10.8
  [925886fa] + OnlineStatsBase v1.4.9
  [429524aa] + Optim v0.22.0
  [bac558e1] + OrderedCollections v1.4.1
  [90014a1f] + PDMats v0.10.1
  [d96e819e] + Parameters v0.12.3
  [2dfb63ee] + PooledArrays v0.5.3
  [85a6dd25] + PositiveFactorizations v0.2.4
  [21216c6a] + Preferences v1.2.3
  [1fd47b50] + QuadGK v2.4.2
  [c84ed2f1] + Ratios v0.4.2
  [ba7d4641] + Recombinase v0.1.1
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.3.0
  [79098fc4] + Rmath v0.7.0
  [a2af1166] + SortingAlgorithms v0.3.1
  [276daf66] + SpecialFunctions v0.10.3
  [90137ffa] + StaticArrays v0.12.5
  [82ae8749] + StatsAPI v1.2.0
  [2913bbd2] + StatsBase v0.32.2
  [4c63d2b9] + StatsFuns v0.9.7
  [09ab397b] + StructArrays v0.4.2
  [ab02a1b2] + TableOperations v0.2.1
  [3783bdb8] + TableTraits v1.0.1
  [382cd787] + TableTraitsUtils v1.0.2
  [bd369af6] + Tables v1.6.1
  [3a884ed6] + UnPack v1.0.2
  [ea10d353] + WeakRefStrings v0.6.2
  [cc8bc4a8] + Widgets v0.6.4
  [efce3f68] + WoodburyMatrices v0.5.5
  [68821587] + Arpack_jll v3.8.0+0
  [f5851436] + FFTW_jll v3.3.10+0
  [1d5cc7b8] + IntelOpenMP_jll v2018.0.3+2
  [856f044c] + MKL_jll v2021.1.1+2
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [f50d1b31] + Rmath_jll v0.3.0+0
  [0dad84c5] + ArgTools
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [f43a241f] + Downloads
  [b77e0a4c] + InteractiveUtils
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [4607b0f0] + SuiteSparse
  [fa267f1f] + TOML
  [a4e569a6] + Tar
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll
  [deac9b47] + LibCURL_jll
  [29816b5a] + LibSSH2_jll
  [c8ffd9c3] + MbedTLS_jll
  [14a3606d] + MozillaCACerts_jll
  [4536629a] + OpenBLAS_jll
  [83775a58] + Zlib_jll
  [8e850b90] + libblastrampoline_jll
  [8e850ede] + nghttp2_jll
  [3f19e933] + p7zip_jll

julia> using MultivariateStats
[ Info: Precompiling MultivariateStats [6f286f6a-111f-5878-ab1e-185364afe411]
ERROR: LoadError: UndefVarError: pairwise! not defined
Stacktrace:
 [1] include
   @ ./Base.jl:418 [inlined]
 [2] 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
 [3] top-level scope
   @ none:1
 [4] eval
   @ ./boot.jl:373 [inlined]
 [5] eval(x::Expr)
   @ Base.MainInclude ./client.jl:453
 [6] top-level scope
   @ none:1
in expression starting at /home/sethaxen/.julia/packages/MultivariateStats/zLpz8/src/MultivariateStats.jl:1
ERROR: Failed to precompile MultivariateStats [6f286f6a-111f-5878-ab1e-185364afe411] to /home/sethaxen/.julia/compiled/v1.7/MultivariateStats/jl_0AvodB.
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
sethaxen commented 2 years ago

I noticed that Recombinase's Project.toml hasn't been updated in 2 years, and it has no CompatHelper workflow, so I'm guessing it's constraining the version(s) of some dependency(ies).