JuliaGizmos / Interact.jl

Interactive widgets to play with your Julia code
Other
520 stars 75 forks source link

WebIOServer not defined #355

Open floswald opened 4 years ago

floswald commented 4 years ago

hi all,

i get this error when using the @manipulate macro in juno:

julia> SFertility.interact()
Error showing value of type Widgets.Widget{:manipulate,Any}:
ERROR: UndefVarError: WebIOServer not defined
Stacktrace:
 [1] setup_server() at /Users/74097/.julia/packages/Atom/ooRtV/src/display/webio.jl:76
 [2] show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::MIME{Symbol("application/prs.juno.plotpane+html")}, ::WebIO.Node{WebIO.DOM}) at /Users/74097/.julia/packages/Atom/ooRtV/src/display/webio.jl:68
 [3] show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::String, ::WebIO.Node{WebIO.DOM}) at ./multimedia.jl:109
 [4] displayinplotpane(::WebIO.Node{WebIO.DOM}) at /Users/74097/.julia/packages/Atom/ooRtV/src/display/showdisplay.jl:51
 [5] display(::Atom.JunoDisplay, ::WebIO.Node{WebIO.DOM}) at /Users/74097/.julia/packages/Atom/ooRtV/src/display/showdisplay.jl:117
 [6] display(::Any) at ./multimedia.jl:323
 [7] display(::Widgets.Widget{:manipulate,Any}) at /Users/74097/.julia/packages/Widgets/451tD/src/widget.jl:136
 [8] #invokelatest#1 at ./essentials.jl:709 [inlined]
 [9] invokelatest at ./essentials.jl:708 [inlined]
 [10] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:156
 [11] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:141
 [12] (::REPL.var"#do_respond#38"{Bool,Atom.var"#224#225",REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:719
 [13] #invokelatest#1 at ./essentials.jl:709 [inlined]
 [14] invokelatest at ./essentials.jl:708 [inlined]
 [15] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/LineEdit.jl:2306
 [16] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:1045
 [17] run_repl(::REPL.AbstractREPL, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:201
 [18] (::Base.var"#770#772"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:382
 [19] #invokelatest#1 at ./essentials.jl:709 [inlined]
 [20] invokelatest at ./essentials.jl:708 [inlined]
 [21] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:366
 [22] exec_options(::Base.JLOptions) at ./client.jl:304
 [23] _start() at ./client.jl:460

where this function is defined as

function interact()
    ρs = 1.0:0.1:2.0
    τms = 0.2:0.01:0.5
    qs = 0.8:0.01:2.0

    mp = @manipulate for ρ in slider(ρs, label = "ρ"),  τm in slider(τms, label = "τm") ,  q in slider(qs, label = "q")
        try
            m,p = run(par = Dict(:ρ => ρ, :τm => τm, :q => q))
            plot_xs(m,p)
        catch
            println("infeasible")
        end
    end
end

here is the status of this project:

Project Fertility v0.1.0
    Status `~/.julia/dev/Fertility/Project.toml`
  [336ed68f] CSV v0.5.26
  [a93c6f00] DataFrames v0.20.2
  [864edb3b] DataStructures v0.17.10
  [c87230d0] FFMPEG v0.3.0
  [442a2c76] FastGaussQuadrature v0.4.2
  [38e38edf] GLM v1.3.7
  [7073ff75] IJulia v1.21.1
  [c601a237] Interact v0.10.3
  [a98d9a8b] Interpolations v0.12.8
  [682c06a0] JSON v0.21.0
  [b964fa9f] LaTeXStrings v1.1.0
  [2774e3e8] NLsolve v4.3.0
  [91a5bcdd] Plots v0.29.5
  [92933f4c] ProgressMeter v1.2.0
  [d330b81b] PyPlot v2.8.2
  [f2b01f46] Roots v1.0.0
  [3eaba693] StatsModels v0.6.10
  [0f1e0344] WebIO v0.8.13
  [de0858da] Printf 
  [10745b16] Statistics 
  [8dfed614] Test 

i'm on atom 1.44, and my atom.jl is

(v1.3) pkg> st
    Status `~/.julia/environments/v1.3/Project.toml`
  [c52e3926] Atom v0.12.8
  [e5e0dc1b] Juno v0.8.1
twavv commented 4 years ago

This is not an Interact issue.

WebIOServer is defined in WebIO.jl when the WebSockets package is loaded (using Requires.jl). The part of Juno that handles displaying WebIO also required WebSockets.jl.

I'm not sure why this error would be happening.

@pfitzseb any thoughts?

pfitzseb commented 4 years ago

Very weird -- the code that throws this error should only ever be loaded after WebIO.

using Interact
@manipulate for i in 1:10
    println(i)
end

works fine for me in Juno.

twavv commented 4 years ago

@floswald Is there anything especially exotic about your Julia/Juno setup? If you install WebIO and WebSockets, does this work?

using WebIO, WebSockets
@show WebIO.WebIOServer

If it does, does your code work in Juno after running that using snippet? If not, my best guess would be some obscure bug in Requires.jl, but that's a pretty common dependency so I wouldn't think it'd be terribly likely to have many bugs left at this point.

floswald commented 4 years ago

thanks guys, I'll have to check when back in office on monday. good news is that the same code (i.e the same project manifest) works perfectly fine for me at home. nothing exotic on the other machine AFAIK, no. I'll be back with more.

errearanhas commented 4 years ago

Hello guys, any specific update on this?

I am having the same problem.

(newEnv) pkg> st
Status `~/nc_files/newEnv/Project.toml`
  [c601a237] Interact v0.10.3
  [ee78f7c6] Makie v0.11.0
  [85f8d34a] NCDatasets v0.10.2
  [2913bbd2] StatsBase v0.33.0
  [0f1e0344] WebIO v0.8.14