-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error needing catching in @iload
?
#385
Comments
Maybe related to JuliaAI/MLJ.jl#757 |
cc @giordano |
Given the issue you're experiencing it's likely there is an exception that isn't being caught, but I can't reproduce your issue in a clean depot:
|
Reading the code, I'm having a hard time figuring out where the exception is being thrown. Can you please show the output of quote
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:129 =#
begin
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:168 =#
true && begin
#= logging.jl:350 =#
let
#= logging.jl:351 =#
var"#47#level" = Base.CoreLogging.Info
#= logging.jl:352 =#
var"#48#std_level" = Base.CoreLogging.convert(Base.CoreLogging.LogLevel, var"#47#level")
#= logging.jl:353 =#
if var"#48#std_level" >= Base.CoreLogging._min_enabled_level[]
#= logging.jl:354 =#
var"#49#group" = :loading
#= logging.jl:355 =#
var"#50#_module" = Main
#= logging.jl:356 =#
var"#51#logger" = Base.CoreLogging.current_logger_for_env(var"#48#std_level", var"#49#group", var"#50#_module")
#= logging.jl:357 =#
if !(var"#51#logger" === Base.CoreLogging.nothing)
#= logging.jl:358 =#
var"#52#id" = :Main_75496672
#= logging.jl:361 =#
if Base.CoreLogging._invoked_shouldlog(var"#51#logger", var"#47#level", var"#50#_module", var"#49#group", var"#52#id")
#= logging.jl:362 =#
var"#53#file" = "/tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl"
#= logging.jl:363 =#
var"#54#line" = 168
#= logging.jl:364 =#
local var"#55#msg", var"#56#kwargs"
#= logging.jl:365 =#
begin
#= logging.jl:308 =#
var"#55#msg" = "For silent loading, specify `verbosity=0`. "
#= logging.jl:309 =#
var"#56#kwargs" = (;)
#= logging.jl:310 =#
true
end && Base.CoreLogging.handle_message(var"#51#logger", var"#47#level", var"#55#msg", var"#50#_module", var"#49#group", var"#52#id", var"#53#file", var"#54#line"; var"#56#kwargs"...)
end
end
end
#= logging.jl:371 =#
Base.CoreLogging.nothing
end
end
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:169 =#
var"#37#proxy" = (MLJModels.MLJModels).info("EvoTreeClassifier"; pkg = nothing, interactive = true)
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:172 =#
var"#38#handle" = (MLJModels.MLJModels).Handle((var"#37#proxy").name, (var"#37#proxy").package_name)
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:173 =#
var"#39#dic" = (MLJModels.MLJModels).INFO_GIVEN_HANDLE[var"#38#handle"]
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:174 =#
(var"#40#path_str", var"#41#pkg_str") = (var"#39#dic"[:load_path], var"#39#dic"[:package_name])
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:175 =#
var"#42#path" = var"#40#path_str" |> (MLJModels.Meta).parse
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:176 =#
var"#43#pkg" = MLJModels.Symbol(var"#41#pkg_str")
end
begin
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:181 =#
var"#44#path_components" = MLJModels.Symbol.(MLJModels.split(var"#40#path_str", '.'))
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:184 =#
var"#45#api_pkg" = var"#44#path_components"[1]
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:185 =#
var"#46#api_pkg_str" = MLJModels.string(var"#45#api_pkg")
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:187 =#
if false || true
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:188 =#
try
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:189 =#
(MLJModels.MLJModels)._import(Main, var"#45#api_pkg", var"#43#pkg", false)
catch
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:191 =#
if true
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:192 =#
(MLJModels.MLJModels).request("The package providing an interface " * "to `EvoTreeClassifier` " * "is not in your " * "current environment.\n" * "What do you want to do? ", "Install $(var"#46#api_pkg_str") in current environment.", "Abort.") == 1 || MLJModels.throw(MLJModels.InterruptException)
end
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:202 =#
(MLJModels.MLJModels)._import(Main, :Pkg, :Pkg, false)
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:203 =#
(MLJModels.Pkg).add(var"#46#api_pkg_str")
end
end
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:206 =#
(MLJModels.MLJModels)._import(Main, var"#45#api_pkg", var"#43#pkg", true)
#= /tmp/tmp.O88ehAk8Zj/packages/MLJModels/9mQfs/src/loading.jl:207 =#
(MLJModels.MLJModels)._eval(Main, var"#42#path")
end
end Trying to load the package before the interactive |
@giordano Thanks for investigating. Naturally this is difficult to debug without being able to reproduce the error. Let me make sure I can also reproduce and get back to you. I actually don't think I was using a fresh environment after all. My apologies for not being more thorough. |
Okay, I do get (a different) error in a bare environment. The error julia> using MLJModels
julia> @iload EvoTreeRegressor
[ Info: For silent loading, specify `verbosity=0`.
[ Info: Precompiling EvoTrees [f6006082-12f8-11e9-0c9c-0d5d367ab1e5]
ERROR: LoadError: ArgumentError: Package StaticArrays [90137ffa-7385-5640-81b9-e52037218182] is required but does not seem to be installed:
- Run `Pkg.instantiate()` to install all recorded dependencies.
Stacktrace:
[1] _require(pkg::Base.PkgId)
@ Base ./loading.jl:990
[2] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:914
[3] require(into::Module, mod::Symbol)
@ Base ./loading.jl:901
[4] include
@ ./Base.jl:386 [inlined]
[5] 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:1213
[6] top-level scope
@ none:1
[7] eval
@ ./boot.jl:360 [inlined]
[8] eval(x::Expr)
@ Base.MainInclude ./client.jl:446
[9] top-level scope
@ none:1
in expression starting at /Users/anthony/Dropbox/Julia7/EvoTrees/src/EvoTrees.jl:1
The package providing an interface to `EvoTreeRegressor` is not in your current environment.
What do you want to do?
Install EvoTrees in current environment.
> Abort. My environment (@testload) pkg> st
Status `~/.julia/environments/testload/Project.toml`
[d491faf4] MLJModels v0.14.6 (@testload) pkg> st -m
Status `~/.julia/environments/testload/Manifest.toml`
[324d7699] CategoricalArrays v0.10.0
[d360d2e6] ChainRulesCore v0.9.44
[3da002f7] ColorTypes v0.11.0
[34da2185] Compat v3.30.0
[ed09eef8] ComputationalResources v0.3.2
[a8cc5b0e] Crayons v4.0.4
[9a962f9c] DataAPI v1.6.0
[864edb3b] DataStructures v0.18.9
[e2d170a0] DataValueInterfaces v1.0.0
[b4f34e82] Distances v0.10.3
[31c24e10] Distributions v0.25.1
[ffbed154] DocStringExtensions v0.8.4
[1a297f60] FillArrays v0.11.7
[53c48c17] FixedPointNumbers v0.8.4
[59287772] Formatting v0.4.2
[41ab1584] InvertedIndices v1.0.0
[82899510] IteratorInterfaceExtensions v1.0.0
[692b3bcd] JLLWrappers v1.3.0
[682c06a0] JSON v0.21.1
[7f8f8fb0] LearnBase v0.4.1
[2ab3a3ac] LogExpFunctions v0.2.4
[30fc2ffe] LossFunctions v0.7.0
[a7f614a8] MLJBase v0.18.7
[e80e1ace] MLJModelInterface v1.1.0
[d491faf4] MLJModels v0.14.6
[2e2323e0] MLJScientificTypes v0.4.7
[e1d29d7a] Missings v1.0.0
[bac558e1] OrderedCollections v1.4.1
[90014a1f] PDMats v0.11.0
[d96e819e] Parameters v0.12.2
[69de0a69] Parsers v1.1.0
[b1ad91c1] PersistenceDiagramsBase v0.1.1
[21216c6a] Preferences v1.2.2
[08abe8d2] PrettyTables v1.0.1
[92933f4c] ProgressMeter v1.6.2
[1fd47b50] QuadGK v2.4.1
[3cdcf5f2] RecipesBase v1.1.1
[189a3867] Reexport v1.0.0
[ae029012] Requires v1.1.3
[79098fc4] Rmath v0.7.0
[321657f4] ScientificTypes v1.1.2
[a2af1166] SortingAlgorithms v1.0.0
[276daf66] SpecialFunctions v1.4.1
[64bff920] StatisticalTraits v1.1.0
[82ae8749] StatsAPI v1.0.0
[2913bbd2] StatsBase v0.33.8
[4c63d2b9] StatsFuns v0.9.8
[856f2bd8] StructTypes v1.7.2
[3783bdb8] TableTraits v1.0.1
[bd369af6] Tables v1.4.2
[3a884ed6] UnPack v1.0.2
[efe28fd5] OpenSpecFun_jll v0.5.4+0
[f50d1b31] Rmath_jll v0.3.0+0
[0dad84c5] ArgTools
[56f22d72] Artifacts
[2a0f44e3] Base64
[ade2ca70] Dates
[8bb1440f] DelimitedFiles
[8ba89e20] Distributed
[f43a241f] Downloads
[9fa8497b] Future
[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
[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
[83775a58] Zlib_jll
[8e850ede] nghttp2_jll
[3f19e933] p7zip_jll
The macro expansion julia> @macroexpand @iload EvoTreeRegressor
quote
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:129 =#
begin
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:168 =#
true && begin
#= logging.jl:350 =#
let
#= logging.jl:351 =#
var"#104#level" = Base.CoreLogging.Info
#= logging.jl:352 =#
var"#105#std_level" = Base.CoreLogging.convert(Base.CoreLogging.LogLevel, var"#104#level")
#= logging.jl:353 =#
if var"#105#std_level" >= Base.CoreLogging._min_enabled_level[]
#= logging.jl:354 =#
var"#106#group" = :loading
#= logging.jl:355 =#
var"#107#_module" = Main
#= logging.jl:356 =#
var"#108#logger" = Base.CoreLogging.current_logger_for_env(var"#105#std_level", var"#106#group", var"#107#_module")
#= logging.jl:357 =#
if !(var"#108#logger" === Base.CoreLogging.nothing)
#= logging.jl:358 =#
var"#109#id" = :Main_75496674
#= logging.jl:361 =#
if Base.CoreLogging._invoked_shouldlog(var"#108#logger", var"#104#level", var"#107#_module", var"#106#group", var"#109#id")
#= logging.jl:362 =#
var"#110#file" = "/Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl"
#= logging.jl:363 =#
var"#111#line" = 168
#= logging.jl:364 =#
local var"#112#msg", var"#113#kwargs"
#= logging.jl:365 =#
begin
#= logging.jl:308 =#
var"#112#msg" = "For silent loading, specify `verbosity=0`. "
#= logging.jl:309 =#
var"#113#kwargs" = (;)
#= logging.jl:310 =#
true
end && Base.CoreLogging.handle_message(var"#108#logger", var"#104#level", var"#112#msg", var"#107#_module", var"#106#group", var"#109#id", var"#110#file", var"#111#line"; var"#113#kwargs"...)
end
end
end
#= logging.jl:371 =#
Base.CoreLogging.nothing
end
end
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:169 =#
var"#94#proxy" = (MLJModels.MLJModels).info("EvoTreeRegressor"; pkg = nothing, interactive = true)
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:172 =#
var"#95#handle" = (MLJModels.MLJModels).Handle((var"#94#proxy").name, (var"#94#proxy").package_name)
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:173 =#
var"#96#dic" = (MLJModels.MLJModels).INFO_GIVEN_HANDLE[var"#95#handle"]
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:174 =#
(var"#97#path_str", var"#98#pkg_str") = (var"#96#dic"[:load_path], var"#96#dic"[:package_name])
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:175 =#
var"#99#path" = var"#97#path_str" |> (MLJModels.Meta).parse
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:176 =#
var"#100#pkg" = MLJModels.Symbol(var"#98#pkg_str")
end
begin
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:181 =#
var"#101#path_components" = MLJModels.Symbol.(MLJModels.split(var"#97#path_str", '.'))
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:184 =#
var"#102#api_pkg" = var"#101#path_components"[1]
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:185 =#
var"#103#api_pkg_str" = MLJModels.string(var"#102#api_pkg")
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:187 =#
if false || true
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:188 =#
try
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:189 =#
(MLJModels.MLJModels)._import(Main, var"#102#api_pkg", var"#100#pkg", false)
catch
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:191 =#
if true
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:192 =#
(MLJModels.MLJModels).request("The package providing an interface " * "to `EvoTreeRegressor` " * "is not in your " * "current environment.\n" * "What do you want to do? ", "Install $(var"#103#api_pkg_str") in current environment.", "Abort.") == 1 || MLJModels.throw(MLJModels.InterruptException)
end
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:202 =#
(MLJModels.MLJModels)._import(Main, :Pkg, :Pkg, false)
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:203 =#
(MLJModels.Pkg).add(var"#103#api_pkg_str")
end
end
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:206 =#
(MLJModels.MLJModels)._import(Main, var"#102#api_pkg", var"#100#pkg", true)
#= /Users/anthony/.julia/packages/MLJModels/9mQfs/src/loading.jl:207 =#
(MLJModels.MLJModels)._eval(Main, var"#99#path")
end
end If I first manually add the required package, |
|
I tried also on macOS in case there is a weird platform-specific issue, but I still can't reproduce your problem there. The expansion of the macro for you is the same as for me, apart from paths and gensym-generated variables. Not that I was expecting something different, but I figured it'd be good to double check it. What about using Also, note that Julia v1.7 has the feature of suggesting to install a package if not available, so the |
@giordano Thanks for investigating. What a pity you are unable to reproduce. I'm inclined to believe the problem lies outside of MLJModels. Why else would reproducibility be an issue? We are using identical Manifests/Project files, yes? I will try your suggestion as a diagnostic. I'm not enthusiastic about it as a solution for the reasons you give. |
It seems there is an error that we are not catching (and ignoring) here, as the interactive part following the message works fine:
The text was updated successfully, but these errors were encountered: