Skip to content
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

ImageIO missing #57

Open
roflmaostc opened this issue May 1, 2023 · 3 comments
Open

ImageIO missing #57

roflmaostc opened this issue May 1, 2023 · 3 comments

Comments

@roflmaostc
Copy link
Member

Hi,

sometimes I get this error.
Should we add ImageIO as dependency or how do we solve that?

Failed to show value:

ArgumentError: Package ImageIO [82e4d734-157c-48bb-816b-45c225c6df19] 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:1306

[2] _require_prelocked(uuidkey::Base.PkgId)

@ Base ./loading.jl:1200

[3] macro expansion

@ ./lock.jl:223 [inlined]

[4] require(uuidkey::Base.PkgId)

@ Base ./loading.jl:1195

[5] #34

@ ~/.julia/packages/FileIO/aP78L/src/loadsave.jl:203 [inlined]

[6] lock(f::FileIO.var"#34#35"{Base.PkgId}, l::ReentrantLock)

@ Base ./lock.jl:185

[7] action(call::Symbol, libraries::Vector{Union{Base.PkgId, Module}}, file::FileIO.Formatted, args::Matrix{ColorTypes.Gray{Float64}}; options::Base.Pairs{Symbol, ImageShow.var"#2#4", Tuple{Symbol}, NamedTuple{(:mapi,), Tuple{ImageShow.var"#2#4"}}})

@ FileIO ~/.julia/packages/FileIO/aP78L/src/loadsave.jl:203

[8] save(file::FileIO.Formatted, args::Matrix{ColorTypes.Gray{Float64}}; options::Base.Pairs{Symbol, ImageShow.var"#2#4", Tuple{Symbol}, NamedTuple{(:mapi,), Tuple{ImageShow.var"#2#4"}}})

@ FileIO ~/.julia/packages/FileIO/aP78L/src/loadsave.jl:135

[9] show(io::IOContext{IOBuffer}, mime::MIME{Symbol("image/png")}, img::Matrix{ColorTypes.Gray{Float64}}; minpixels::Int64, maxpixels::Int64, mapi::Function)

@ ImageShow ~/.julia/packages/ImageShow/9E6uM/src/showmime.jl:47

[10] show(io::IOContext{IOBuffer}, mime::MIME{Symbol("image/png")}, img::Matrix{ColorTypes.Gray{Float64}})

@ ImageShow ~/.julia/packages/ImageShow/9E6uM/src/showmime.jl:29

[11] show_richest(io::IOContext{IOBuffer}, x::Any)

@ Main.PlutoRunner ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:1175

[12] show_richest_withreturned

@ ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:1100 [inlined]

[13] format_output_default(val::Any, context::Any)

@ Main.PlutoRunner ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:1000

[14] #format_output#61

@ ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:1017 [inlined]

[15] #53

@ ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:909 [inlined]

[16] with_io_to_logs(f::Main.PlutoRunner.var"#53#56"{Module, Matrix{ColorTypes.Gray{Float64}}, Dict{Tuple{UInt64, Int64}, Int64}}; enabled::Bool, loglevel::Base.CoreLogging.LogLevel)

@ Main.PlutoRunner ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:2424

[17] (::Main.PlutoRunner.var"#119#120"{Bool, Base.CoreLogging.LogLevel, Main.PlutoRunner.var"#53#56"{Module, Matrix{ColorTypes.Gray{Float64}}, Dict{Tuple{UInt64, Int64}, Int64}}})()

@ Main.PlutoRunner ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:2448

[18] with_logstate(f::Function, logstate::Any)

@ Base.CoreLogging ./logging.jl:511

[19] with_logger

@ ./logging.jl:623 [inlined]

[20] #with_logger_and_io_to_logs#118

@ ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:2447 [inlined]

[21] formatted_result_of(notebook_id::Base.UUID, cell_id::Base.UUID, ends_with_semicolon::Bool, known_published_objects::Vector{String}, showmore::Nothing, workspace::Module; capture_stdout::Bool)

@ Main.PlutoRunner ~/.julia/packages/Pluto/ZBojR/src/runner/PlutoRunner.jl:908

[22] top-level scope

@ ~/.julia/packages/Pluto/ZBojR/src/evaluation/WorkspaceManager.jl:527

    handle_error(::ArgumentError, ::Base.PkgId, ::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})@error_handling.jl:61
    handle_exceptions(::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, ::String)@error_handling.jl:56
    var"#action#33"(::Base.Pairs{Symbol, ImageShow.var"#2#4", Tuple{Symbol}, NamedTuple{(:mapi,), Tuple{ImageShow.var"#2#4"}}}, ::typeof(FileIO.action), ::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted, ::Matrix{ColorTypes.Gray{Float64}})@loadsave.jl:228
    var"#save#21"(::Base.Pairs{Symbol, ImageShow.var"#2#4", Tuple{Symbol}, NamedTuple{(:mapi,), Tuple{ImageShow.var"#2#4"}}}, ::typeof(FileIO.save), ::FileIO.Formatted, ::Matrix{ColorTypes.Gray{Float64}})@loadsave.jl:135
    var"#show#1"(::Int64, ::Int64, ::Function, ::typeof(show), ::IOContext{IOBuffer}, ::MIME{Symbol("image/png")}, ::Matrix{ColorTypes.Gray{Float64}})@showmime.jl:47
    show(::IOContext{IOBuffer}, ::MIME{Symbol("image/png")}, ::Matrix{ColorTypes.Gray{Float64}})@showmime.jl:29
    show_richest(::IOContext{IOBuffer}, ::Any)@PlutoRunner.jl:1175
    [email protected]:1100[inlined]
    format_output_default(::Any, ::Any)@PlutoRunner.jl:1000
    #format_output#[email protected]:1017[inlined]
    #[email protected]:909[inlined]
    var"#with_io_to_logs#115"(::Bool, ::Base.CoreLogging.LogLevel, ::typeof(Main.PlutoRunner.with_io_to_logs), ::Main.PlutoRunner.var"#53#56"{Module, Matrix{ColorTypes.Gray{Float64}}, Dict{Tuple{UInt64, Int64}, Int64}})@PlutoRunner.jl:2424
    (::Main.PlutoRunner.var"#119#120"{Bool, Base.CoreLogging.LogLevel, Main.PlutoRunner.var"#53#56"{Module, Matrix{ColorTypes.Gray{Float64}}, Dict{Tuple{UInt64, Int64}, Int64}}})()@PlutoRunner.jl:2448
    with_logstate(::Function, ::Any)@logging.jl:511
    [email protected]:623[inlined]
    #with_logger_and_io_to_logs#[email protected]:2447[inlined]
    var"#formatted_result_of#50"(::Bool, ::typeof(Main.PlutoRunner.formatted_result_of), ::Base.UUID, ::Base.UUID, ::Bool, ::Vector{String}, ::Nothing, ::Module)@PlutoRunner.jl:908
    top-level [email protected]:527
@timholy
Copy link
Member

timholy commented May 1, 2023

It should be in your own environment. FileIO is designed to know which packages to use, but it's up to the user to add them to the environment. If you can suggest a clearer error, I'm happy to hear it.

@roflmaostc
Copy link
Member Author

So in my case I just put ImageShow as package and then it complains about the ImageIO issue. For example in a Pluto notebook

@timholy
Copy link
Member

timholy commented May 3, 2023

Yes. The issue seems to be that Pluto is triggering display. For display it seems it needs to save an image to file (possibly for the interaction with the browser?) but you didn't add an IO package to your environment. FileIO is designed to be generic and allow the user to choose which IO package to use. Consequently, I'd interpret this as "user error" but the error message may be too unclear to make that interpretation valid. I'd be grateful if you could suggest ways we could make this clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants