Problem with precompiling Plots in Julia 1.8.2

Hello I have problems using Plots after installing
Julia 1.8.2, precompiling does not work,
how to solve this problem ?
Thanks a lot

here the errors:

_ _ ()_ | Documentation: https://docs.julialang.org
() | () () |
_ _ | | __ _ | Type “?” for help, “]?” for Pkg help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 1.8.2 (2022-09-29)
/ |_|||_’_| | Official https://julialang.org/ release
|__/ |

julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
ERROR: LoadError: MethodError: no method matching floatrange(::Type{Float64}, ::Int64, ::Int64, ::Float64, ::Int64)
Closest candidates are:
floatrange(::Type{T}, ::Integer, ::Integer, ::Integer, ::Integer) where T at twiceprecision.jl:381
floatrange(::AbstractFloat, ::AbstractFloat, ::Real, ::AbstractFloat) at twiceprecision.jl:395
Stacktrace:
[1] floatrange(a::Float64, st::Float64, len::Float64, divisor::Float64)
@ Base ./twiceprecision.jl:403
[2] histrange(lo::Float64, hi::Float64, n::Int64, closed::Symbol)
@ StatsBase ~/.julia/packages/StatsBase/548SN/src/hist.jl:99
[3] histrange(v::Vector{Float64}, n::Int64, closed::Symbol)
@ StatsBase ~/.julia/packages/StatsBase/548SN/src/hist.jl:39
[4] _hist_edge
@ ~/.julia/packages/Plots/CUQan/src/recipes.jl:798 [inlined]
[5] #212
@ ~/.julia/packages/Plots/CUQan/src/recipes.jl:811 [inlined]
[6] map
@ ./tuple.jl:222 [inlined]
[7] _hist_edges
@ ~/.julia/packages/Plots/CUQan/src/recipes.jl:811 [inlined]
[8] _make_hist(vs::Tuple{Vector{Float64}, Vector{Float64}}, binning::Int64; normed::Bool, weights::Nothing)
@ Plots ~/.julia/packages/Plots/CUQan/src/recipes.jl:830
[9] macro expansion
@ ~/.julia/packages/Plots/CUQan/src/recipes.jl:952 [inlined]
[10] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, #unused#::Type{Val{:histogram2d}}, x::Any, y::Any, z::Any)
@ Plots ~/.julia/packages/RecipesBase/apcHH/src/RecipesBase.jl:290
[11] _process_seriesrecipe(plt::Any, plotattributes::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/OfK61/src/series_recipe.jl:50
[12] _process_seriesrecipes!(plt::Any, kw_list::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/OfK61/src/series_recipe.jl:27
[13] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/OfK61/src/RecipesPipeline.jl:99
[14] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
@ Plots ~/.julia/packages/Plots/CUQan/src/plot.jl:232
[15] #plot#152
@ ~/.julia/packages/Plots/CUQan/src/plot.jl:107 [inlined]
[16] #histogram2d#477
@ ~/.julia/packages/RecipesBase/apcHH/src/RecipesBase.jl:411 [inlined]
[17] var"##10#320"()
@ Plots ~/.julia/packages/Plots/CUQan/src/precompilation.jl:15
[18] top-level scope
@ ~/.julia/packages/Plots/CUQan/src/precompilation.jl:25
[19] eval
@ ./boot.jl:368 [inlined]
[20] eval
@ ~/.julia/packages/Plots/CUQan/src/Plots.jl:1 [inlined]
[21] _broadcast_getindex_evalf
@ ./broadcast.jl:670 [inlined]
[22] _broadcast_getindex
@ ./broadcast.jl:643 [inlined]
[23] getindex
@ ./broadcast.jl:597 [inlined]
[24] copyto_nonleaf!(dest::Vector{Nothing}, bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(Plots.eval), Tuple{Base.Broadcast.Extruded{Vector{Expr}, Tuple{Bool}, Tuple{Int64}}}}, iter::Base.OneTo{Int64}, state::Int64, count::Int64)
@ Base.Broadcast ./broadcast.jl:1055
[25] copy(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(Plots.eval), Tuple{Vector{Expr}}})
@ Base.Broadcast ./broadcast.jl:907
[26] materialize
@ ./broadcast.jl:860 [inlined]
[27] macro expansion
@ ~/.julia/packages/Plots/CUQan/src/precompilation.jl:32 [inlined]
[28] macro expansion
@ ~/.julia/packages/SnoopPrecompile/UWvXF/src/SnoopPrecompile.jl:51 [inlined]
[29] (::Plots.var"#589#590")()
@ Plots ~/.julia/packages/Plots/CUQan/src/precompilation.jl:29
[30] withenv(f::Plots.var"#589#590", keyvals::Pair{String, String})
@ Base ./env.jl:172
[31] macro expansion
@ ~/.julia/packages/Plots/CUQan/src/precompilation.jl:28 [inlined]
[32] macro expansion
@ ~/.julia/packages/SnoopPrecompile/UWvXF/src/SnoopPrecompile.jl:107 [inlined]
[33] top-level scope
@ ~/.julia/packages/Plots/CUQan/src/precompilation.jl:4
[34] include(mod::Module, _path::String)
@ Base ./Base.jl:419
[35] include(x::String)
@ Plots ~/.julia/packages/Plots/CUQan/src/Plots.jl:1
[36] top-level scope
@ ~/.julia/packages/Plots/CUQan/src/Plots.jl:204
[37] include
@ ./Base.jl:419 [inlined]
[38] 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:1554
[39] top-level scope
@ stdin:1
in expression starting at /home/gasbarra/.julia/packages/Plots/CUQan/src/precompilation.jl:3
in expression starting at /home/gasbarra/.julia/packages/Plots/CUQan/src/Plots.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /home/gasbarra/.julia/compiled/v1.8/Plots/jl_lqx2cE.
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

Can you post the output of:

(@v1.8) pkg> status -m Plots GR StatsBase
[...] ?

Here it is :

(v1.8) pkg> status -m Plots GR StatsBase
Status /home/local/gasbarra/.julia/environments/v1.8/Manifest.toml
[28b8d3ca] GR v0.69.3
[91a5bcdd] Plots v1.35.2
⌅ [2913bbd2] StatsBase v0.32.2
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use status --outdated -m

(v1.8) pkg> status --outdated -m
Status /home/local/gasbarra/.julia/environments/v1.8/Manifest.toml
⌅ [14f7f29c] AMD v0.4.0 (<v0.5.0): COSMO, LDLFactorizations, QDLDL
⌅ [1520ce14] AbstractTrees v0.3.4 (<v0.4.2): Convex
⌅ [4fba245c] ArrayInterface v2.14.17 (<v6.0.23): DiffEqDiffTools
⌃ [1e616198] COSMO v0.8.2 (<v0.8.6)
⌃ [13f3f980] CairoMakie v0.6.2 (<v0.8.13)
⌅ [324d7699] CategoricalArrays v0.8.3 (<v0.10.7): DataFrames
⌅ [34da2185] Compat v2.2.1 (<v4.2.0): DataFrames, MathOptInterfaceMosek
⌅ [25c3070e] ComplexOptInterface v0.0.2 (<v0.1.2): SumOfSquares
⌅ [d38c429a] Contour v0.5.7 (<v0.6.2): Gadfly, Makie, UnicodePlots
⌃ [f65535da] Convex v0.14.18 (<v0.15.2)
⌃ [a93c6f00] DataFrames v0.21.8 (<v1.4.0)
⌅ [864edb3b] DataStructures v0.17.20 (<v0.18.13): StatsBase
⌅ [31c24e10] Distributions v0.23.8 (<v0.25.75): Gadfly, KernelDensity
⌅ [ffbed154] DocStringExtensions v0.8.6 (<v0.9.1): Gadfly, Makie, PlotlyBase, TiffImages
⌅ [7c1d4256] DynamicPolynomials v0.3.21 (<v0.4.5): MomentOpt
⌃ [e2685f51] ECOS v0.12.3 (<v1.1.0)
⌃ [da5c29d0] EllipsisNotation v1.0.0 (<v1.6.0)
⌃ [48062228] FilePathsBase v0.9.16 (<v0.9.20)
⌅ [1a297f60] FillArrays v0.8.14 (<v0.13.4): Distributions, Optim
⌅ [663a7486] FreeTypeAbstraction v0.9.1 (<v0.10.0): Makie, UnicodePlots
⌃ [60bf3e95] GLPK v0.14.14 (<v1.1.0)
⌃ [c91e804a] Gadfly v1.3.3 (<v1.3.4)
⌅ [14197337] GenericLinearAlgebra v0.2.7 (<v0.3.3): Hypatia, Polyhedra
⌅ [5c1252a2] GeometryBasics v0.3.12 (<v0.4.4): CairoMakie, FreeTypeAbstraction, GridLayoutBase, Makie, NetworkLayout, Packing
⌃ [bd48cda9] GraphRecipes v0.5.10 (<v0.5.12)
⌃ [86223c79] Graphs v1.5.0 (<v1.7.4)
⌅ [3955a311] GridLayoutBase v0.5.7 (<v0.9.1): Makie
⌅ [f67ccb44] HDF5 v0.13.7 (<v0.16.11): JLD, MAT
⌅ [cd3eb016] HTTP v0.8.19 (<v1.4.0): JSONSchema, Mux, Plotly, WebSockets
⌃ [b99e6be6] Hypatia v0.4.0 (<v0.7.0)
⌃ [2803e5a7] ImageAxes v0.6.9 (<v0.6.10)
⌃ [f332f351] ImageContrastAdjustment v0.3.7 (<v0.3.10)
⌅ [a09fc81d] ImageCore v0.8.22 (<v0.9.4): ImageContrastAdjustment, ImageDistances, ImageFiltering, ImageMetadata, ImageMorphology, ImageQualityIndexes, Images, Netpbm
⌃ [51556ac3] ImageDistances v0.2.13 (<v0.2.16)
⌅ [6a3955dd] ImageFiltering v0.6.21 (<v0.7.2): ImageQualityIndexes, Images
⌅ [82e4d734] ImageIO v0.5.9 (<v0.6.6): Images, Makie
⌃ [bc367c6b] ImageMetadata v0.9.5 (<v0.9.8)
⌅ [787d08f9] ImageMorphology v0.2.11 (<v0.4.3): ImageDistances, Images
⌅ [2996bd0c] ImageQualityIndexes v0.2.2 (<v0.3.3): Images
⌃ [4e3cecfd] ImageShow v0.3.1 (<v0.3.6)
⌅ [02fcd773] ImageTransformations v0.8.13 (<v0.9.5): ImageContrastAdjustment, Images
⌃ [86fae568] ImageView v0.10.14 (<v0.11.1)
⌅ [916415d5] Images v0.24.1 (<v0.25.2): ImageView
⌅ [9b13fd28] IndirectArrays v0.5.1 (<v1.0.0): Gadfly, ImageMetadata, Images
⌅ [a98d9a8b] Interpolations v0.12.10 (<v0.14.5): ImageTransformations, KernelDensity
⌅ [8197267c] IntervalSets v0.5.4 (<v0.7.3): GtkReactive, Makie
⌃ [4138dd39] JLD v0.10.0 (<v0.13.2)
⌃ [033835bb] JLD2 v0.4.3 (<v0.4.24)
⌅ [7d188eb4] JSONSchema v0.3.3 (<v1.0.1): MathOptInterface
⌅ [4076af6c] JuMP v0.21.4 (<v1.3.1): MomentOpt, ParameterJuMP, PolyJuMP, Polyhedra, SumOfSquares
⌃ [5ab0869b] KernelDensity v0.5.1 (<v0.6.5)
⌅ [40e66cde] LDLFactorizations v0.8.2 (<v0.9.0): Convex
⌃ [d3d80556] LineSearches v7.1.1 (<v7.2.0)
⌃ [23992714] MAT v0.8.1 (<v0.10.3)
⌅ [ee78f7c6] Makie v0.14.2 (<v0.17.13): CairoMakie
⌅ [20f20a25] MakieCore v0.1.3 (<v0.4.0): Makie
⌅ [dbb5928d] MappedArrays v0.3.0 (<v0.4.1): NIfTI
⌅ [b8f27783] MathOptInterface v0.9.22 (<v1.8.2): COSMO, ComplexOptInterface, Convex, ECOS, GLPK, Hypatia, JuMP, MathOptInterfaceMosek, MomentOpt, MosekTools, ParameterJuMP, PolyJuMP, SCS, SumOfSquares
⌅ [e1d29d7a] Missings v0.4.5 (<v1.0.2): CategoricalArrays, DataFrames, StatsBase
⌃ [78c3b35d] Mocking v0.7.2 [<v0.7.4], (<v0.7.3)
⌅ [6405355b] Mosek v0.9.13 (<v10.0.1): MathOptInterfaceMosek, MosekTools
⌃ [1ec41992] MosekTools v0.7.5 (<v0.13.0)
⌃ [be282fd4] MultivariateBases v0.1.3 (<v0.1.5)
⌃ [f4abf1af] MultivariateMoments v0.3.6 (<v0.3.9)
⌅ [102ac46a] MultivariatePolynomials v0.3.18 (<v0.4.6): DynamicPolynomials, MomentOpt, MultivariateBases, MultivariateMoments, PolyJuMP, SemialgebraicSets, SumOfSquares
⌅ [6f286f6a] MultivariateStats v0.9.0 (<v0.10.0): StatsPlots
⌅ [d8a4904e] MutableArithmetics v0.2.22 (<v1.0.4): ComplexOptInterface, DynamicPolynomials, JuMP, MathOptInterface, MomentOpt, MultivariateBases, MultivariateMoments, MultivariatePolynomials, ParameterJuMP, Polyhedra, Polynomials, SumOfSquares
⌅ [a975b10e] Mux v0.7.6 (<v1.0.0): Blink
⌅ [d41bc354] NLSolversBase v7.5.0 (<v7.8.2): Optim
⌅ [77ba4419] NaNMath v0.3.7 (<v1.0.1): JuMP, LineSearches, Optim
⌃ [f09324ee] Netpbm v1.0.1 (<v1.0.2)
⌃ [46757867] NetworkLayout v0.4.0 (<v0.4.4)
⌅ [510215fc] Observables v0.4.0 (<v0.5.2): GridLayoutBase, Makie, MakieCore
⌅ [429524aa] Optim v0.20.1 (<v1.7.3): KernelDensity
⌅ [90014a1f] PDMats v0.10.1 (<v0.11.16): Distributions
⌃ [19eb6ba3] Packing v0.4.1 (<v0.4.2)
⌃ [774612a8] ParameterJuMP v0.3.0 (<v0.4.1)
⌅ [eebad327] PkgVersion v0.1.1 (<v0.3.2): TiffImages
⌃ [995b91a9] PlotUtils v1.2.0 (<v1.3.1)
⌃ [58dd65bb] Plotly v0.3.0 (<v0.4.1)
⌅ [a03496cd] PlotlyBase v0.5.4 (<v0.8.19): PlotlyJS
⌅ [f0f68f2c] PlotlyJS v0.14.1 (<v0.18.9): Plotly
⌅ [ddf597a6] PolyJuMP v0.4.1 (<v0.6.2): MomentOpt, SumOfSquares
⌃ [67491407] Polyhedra v0.6.17 (<v0.7.5)
⌅ [f27b6e38] Polynomials v2.0.17 (<v3.2.0): Jacobi
⌅ [2dfb63ee] PooledArrays v0.5.3 (<v1.4.2): DataFrames
⌅ [bfc457fd] QDLDL v0.1.5 (<v0.3.0): COSMO
⌅ [94ee1d12] Quaternions v0.4.9 (<v0.5.7): Rotations
⌅ [189a3867] Reexport v0.2.0 (<v1.2.2): DataFrames, MomentOpt, Plotly, SumOfSquares
⌃ [6038ab10] Rotations v1.2.0 (<v1.3.2)
⌃ [c946c3f1] SCS v0.7.1 (<v1.1.2)
⌃ [8e049039] SemialgebraicSets v0.2.3 (<v0.2.5)
⌅ [a2af1166] SortingAlgorithms v0.3.1 (<v1.0.1): DataFrames, StatsBase
⌅ [276daf66] SpecialFunctions v0.10.3 (<v2.1.7): Distributions, Jacobi, StatsFuns
⌅ [90137ffa] StaticArrays v0.12.5 (<v1.5.9): DiffEqDiffTools, Interpolations
⌅ [2913bbd2] StatsBase v0.32.2 (<v0.33.21): Optim
⌅ [4c63d2b9] StatsFuns v0.9.7 (<v1.0.1): Distributions, Makie
⌃ [f3b207a7] StatsPlots v0.15.1 (<v0.15.3)
⌅ [09ab397b] StructArrays v0.5.1 (<v0.6.12): GeometryBasics, Makie
⌅ [4b9e565b] SumOfSquares v0.4.3 (<v0.6.2): MomentOpt
⌅ [731e570b] TiffImages v0.4.3 (<v0.6.1): ImageIO
⌅ [06e1c1a7] TiledIteration v0.3.1 (<v0.4.1): ImageFiltering, ImageMorphology, Images
⌃ [b8865327] UnicodePlots v2.12.4 (<v3.1.3)
⌅ [a5390f91] ZipFile v0.9.4 (<v0.10.0): JSONSchema
⌅ [c2c64177] ECOS_jll v2.0.5+1 (<v200.0.800+0): ECOS
⌅ [e8aa6df9] GLPK_jll v5.0.0+0 (<v5.0.1+0): GLPK
⌅ [0234f1f7] HDF5_jll v1.10.5+7 (<v1.12.2+2): HDF5
⌅ [c73af94c] ImageMagick_jll v6.9.10-12+3 (<v6.9.12+3): ImageMagick
⌅ [f7e6163d] Kaleido_jll v0.1.0+0 (<v0.2.1+0): PlotlyBase
⌅ [af6e375f] SCS_GPU_jll v2.1.4+0 (<v3.2.0+0): SCS
⌅ [f4f2fc5b] SCS_jll v2.1.2+1 (<v3.2.0+0): SCS
⌅ [214eeab7] fzf_jll v0.29.0+0 (<v0.30.0+0): JLFzf
⌅ [78c6b45d] glmnet_jll v2.0.13+0 (<v5.0.0+0): GLMNet

This explains it, Optim is holding back StatsBase.

 ⌅ [2913bbd2] StatsBase v0.32.2 (<v0.33.21): Optim

Either remove it or solve why Optim 0.20.1 can’t be updated to latest 1.7.3.
Side note: you should work with projects: you seem to have too many packages in the default project, causing compatibility issues like this one.

In the mean time, I think we should drop StatsBase 0.32 compat in Plots.

EDIT: dropped in this PR: drop `StatsBase` 0.32 by t-bltg · Pull Request #4423 · JuliaPlots/Plots.jl · GitHub.

Thanks a lot, I am new to Julia and I did not know
that should work with projects. Since I have
too many packages installed perhaps I should
just delete ~/.julia and reinstall only those needed

Please read: Working with Julia projects | Julia programming notes

2 Likes

I am getting the same problem with Julia 1.8.3. Please help me out.

Did you try to install it in a fresh environment?

What is the out output of:

pkg> st

Now it is working, but sometimes when i opened an old jupyter notebook, i get some error.
Now i am having only problem is adding ClassImbalance package. So can you help me in this case?