MethodError: no method matching floatrange when running histogram. 1.7.0 Win 11 21H2 AMD 5900Hx

julia> histogram(eruptions,label="eruptions")

MethodError: no method matching floatrange(::Type{Float64}, ::Int64, ::Int64, ::Float64, ::Int64)
Closest candidates are:
  floatrange(::Type{T}, ::Integer, ::Integer, ::Integer, ::Integer) where T at C:\Users\bokhu\AppData\Local\Programs\Julia-1.7.0\share\julia\base\twiceprecision.jl:370
  floatrange(::AbstractFloat, ::AbstractFloat, ::Real, ::AbstractFloat) at C:\Users\bokhu\AppData\Local\Programs\Julia-1.7.0\share\julia\base\twiceprecision.jl:384

Stacktrace:
  [1] floatrange(a::Float64, st::Float64, len::Float64, divisor::Float64)
    @ Base .\twiceprecision.jl:392
  [2] histrange(lo::Float64, hi::Float64, n::Int64, closed::Symbol)
    @ StatsBase C:\Users\bokhu\.julia\packages\StatsBase\DU1bT\src\hist.jl:99
  [3] histrange(v::Vector{Float64}, n::Int64, closed::Symbol)
    @ StatsBase C:\Users\bokhu\.julia\packages\StatsBase\DU1bT\src\hist.jl:39
  [4] _hist_edge
    @ C:\Users\bokhu\.julia\packages\Plots\FKcum\src\recipes.jl:806 [inlined]
  [5] _hist_edge
    @ C:\Users\bokhu\.julia\packages\Plots\FKcum\src\recipes.jl:808 [inlined]
  [6] #205
    @ C:\Users\bokhu\.julia\packages\Plots\FKcum\src\recipes.jl:822 [inlined]
  [7] map
    @ .\tuple.jl:221 [inlined]
  [8] _hist_edges
    @ C:\Users\bokhu\.julia\packages\Plots\FKcum\src\recipes.jl:822 [inlined]
  [9] _make_hist(vs::Tuple{Vector{Float64}}, binning::Symbol; normed::Bool, weights::Nothing)
    @ Plots C:\Users\bokhu\.julia\packages\Plots\FKcum\src\recipes.jl:841
 [10] macro expansion
    @ C:\Users\bokhu\.julia\packages\Plots\FKcum\src\recipes.jl:865 [inlined]
 [11] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, #unused#::Type{Val{:barhist}}, x::Any, y::Any, z::Any)
    @ Plots C:\Users\bokhu\.julia\packages\RecipesBase\qpxEX\src\RecipesBase.jl:289
 [12] _process_seriesrecipe(plt::Any, plotattributes::Any)
    @ RecipesPipeline C:\Users\bokhu\.julia\packages\RecipesPipeline\bexlW\src\series_recipe.jl:50
 [13] _process_seriesrecipe(plt::Any, plotattributes::Any)
    @ RecipesPipeline C:\Users\bokhu\.julia\packages\RecipesPipeline\bexlW\src\series_recipe.jl:60
 [14] _process_seriesrecipes!(plt::Any, kw_list::Any)
    @ RecipesPipeline C:\Users\bokhu\.julia\packages\RecipesPipeline\bexlW\src\series_recipe.jl:27
 [15] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline C:\Users\bokhu\.julia\packages\RecipesPipeline\bexlW\src\RecipesPipeline.jl:97
 [16] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots C:\Users\bokhu\.julia\packages\Plots\FKcum\src\plot.jl:172
 [17] #plot#150
    @ C:\Users\bokhu\.julia\packages\Plots\FKcum\src\plot.jl:58 [inlined]
 [18] histogram(args::Any; kw::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ Plots C:\Users\bokhu\.julia\packages\RecipesBase\qpxEX\src\RecipesBase.jl:410
 [19] top-level scope
    @ In[25]:1
 [20] eval
    @ .\boot.jl:373 [inlined]
 [21] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1196```

That is from the course below:
https://juliaacademy.com/courses/937702/lectures/17339512

Apologies if this is really basic, absolute beginner here.
1 Like

Please make it easier to help you my writing a Minimum Working Example so we can reproduce your problem. Read this guide for more information on how to structure a question.

1 Like

Update StatsBase (https://github.com/JuliaStats/StatsBase.jl/pull/703)

1 Like

Hi. I still have the same problem in the same course on Julia Academy - on 21/January/2022.

I’ve installed Julia 1.7.1 on Ubuntu 20.04.

To reproduce the problem, please run the following notebook https://github.com/JuliaAcademy/DataScience/blob/main/03.%20Statistics.ipynb

1 Like

Just echoing this ^, still seeing the same issue on a fresh Julia 1.7.1 install and in the same part of the same notebook from the Academy. would a rollback in StatsBase build help maybe? If so, anyone know the last build that this worked on?

Hi. After spending literally hours to understand the cause of this problem, I can report that now histogram works correctly!

I found the problem being that the DataScience repository contains old Manifest / Project files that some how create the problem.
If you delete them in the repository you are good to go.

thanks @enzomar ! Just to be clear we should delete specific line items in the manifest/project files, or delete them entirely and manually add the packages to recreate them?

Thanks again

Deleting the files did not resolve the issue for me, but thanks for trying to find something!

Same problem here… any chance someone found a solution?

I am also getting the same error with Julia 1.7.3 version. Please help me out. Thank you in advance.