I’m new. Just installed Julia 1.11.6 a few days ago. When I try to start pluto I get a methoderror exception. Ideas?? Kinda discouraging when the recommended platform wont even start.
julia> using Pluto
julia> Pluto.run()
Opening localhost:1234/?secret=EA12hIM in your default browser… ~ have fun!
Press Ctrl+C in this terminal to stop Pluto
┌ Error:
│ exception =
│ MethodError: Cannot convert an object of type
│ SubArray{UInt8,1,Memory{UInt8},Tuple{UnitRange{Int64}},true} to an object of type
│ SubArray{UInt8,1,Vector{UInt8},Tuple{UnitRange{Int64}},true}
│ The function convert exists, but no method is defined for this combination of argument types.
│
│ Closest candidates are:
│ SubArray{T, N, P, I, L}(::Any, ::Any, ::Any, ::Any) where {T, N, P, I, L}
│ @ Base subarray.jl:19
│ convert(::Type{T}, ::T) where T
│ @ Base Base.jl:126
│ convert(::Type{T}, ::T) where T<:AbstractArray
│ @ Base abstractarray.jl:16
│ …
│
│ Stacktrace:
│ [1] readuntil(buf::IOBuffer, find_delimiter::typeof(HTTP.Parsers.find_end_of_header))
│ @ HTTP.IOExtras C:\Users\apchar.julia\packages\HTTP\aTjcj\src\IOExtras.jl:139
│ [2] readuntil(t::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, f::Function, sizehint::Int64)
│ @ HTTP.ConnectionPool C:\Users\apchar.julia\packages\HTTP\aTjcj\src\ConnectionPool.jl:296
│ [3] readuntil(t::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, f::Function)
Hi, and welcome to the community!
This looks like a situation where you initially installed Pluto in a Julia 1.10 environment but then upgraded the language to 1.11 without re-resolving the packages. What is the output of Pkg.status()? Does running Pkg.resolve() make things better?
julia> Pkg.status()
Status C:\Users\apchar\.julia\environments\v1.11\Project.toml
[0e736298] Bessels v0.2.8
[5ae59095] Colors v0.13.1
[7876af07] Example v0.5.5
[7a1cc6ca] FFTW v1.9.0
[e48b7b93] FundamentalsNumericalComputation v0.4.5
[4b11ee91] Gaston v2.0.0
[4df31cd9] Grassmann v0.8.42
[7073ff75] IJulia v1.30.3
[d0351b0e] InspectDR v0.4.6
[b964fa9f] LaTeXStrings v1.4.0
[3db4a2ba] LegendrePolynomials v0.4.5
[58dd65bb] Plotly v0.4.1
[91a5bcdd] Plots v1.40.19
⌃ [c3e4b0f8] Pluto v0.14.2
[27ebfcd6] Primes v0.5.7
[d330b81b] PyPlot v2.11.6
[0c5d862f] Symbolics v6.54.0
[b8865327] UnicodePlots v3.8.1
Info Packages marked with ⌃ have new versions available and may be upgradable.
julia> Pkg.resolve()
No Changes to C:\Users\apchar\.julia\environments\v1.11\Project.toml
No Changes to C:\Users\apchar\.julia\environments\v1.11\Manifest.toml
(@v1.11) pkg> update Pluto
Updating registry at C:\Users\apchar\.julia\registries\General.toml
No Changes to C:\Users\apchar\.julia\environments\v1.11\Project.toml
No Changes to C:\Users\apchar\.julia\environments\v1.11\Manifest.toml
julia> Pkg.status()
Status C:\Users\apchar\.julia\environments\v1.11\Project.toml
[0e736298] Bessels v0.2.8
[5ae59095] Colors v0.13.1
[7876af07] Example v0.5.5
[7a1cc6ca] FFTW v1.9.0
[e48b7b93] FundamentalsNumericalComputation v0.4.5
[4b11ee91] Gaston v2.0.0
[4df31cd9] Grassmann v0.8.42
[7073ff75] IJulia v1.30.3
[d0351b0e] InspectDR v0.4.6
[b964fa9f] LaTeXStrings v1.4.0
[3db4a2ba] LegendrePolynomials v0.4.5
[58dd65bb] Plotly v0.4.1
[91a5bcdd] Plots v1.40.19
⌃ [c3e4b0f8] Pluto v0.14.2
[27ebfcd6] Primes v0.5.7
[d330b81b] PyPlot v2.11.6
[0c5d862f] Symbolics v6.54.0
[b8865327] UnicodePlots v3.8.1
Info Packages marked with ⌃ have new versions available and may be upgradable.
For once, the error message is clear enough. All versions of Plotly.jl restrict HTTP.jl to v0, all versions of Pluto.jl restricts HTTP.jl to v1. That’s in large part due to Plotly.jl being an abandoned package that last released in 2018 (though it has a few commits since) and Pluto.jl starting releases in 2020. It’s generally difficult for packages whose development lifetimes don’t overlap much to be compatible, and these 2 packages don’t overlap at all. I honestly don’t know why Plotly.jl hasn’t had an update because it and the active PlotlyJS.jl still cross-reference each other and point out that Plotly has cloud features.
As mentioned, Plotly.jl has been in a state of abandonment for a long time now.
If you want to use the plotting capabilities of Plotly in a Pluto notebook, from my own experience, you have two main possibilities: using PlotlyJS.jl, or PlutoPlotly.jl.
If you want to stick to PlotlyJS.jl, there are some tweaks that you should take into account. The original plot function, will become Plot, otherwise, you will get the the old error “WebIO not detected”. See an image attached for an example. Furthermore, you have to specify the height of the plot you want to see in the notebook (otherwise, you will get a stretched view of your plot, see image for an example). Untill now, with some small contributions of yours, you will get Plotly plotting working well in a Pluto notebook. However, there is one problem that I do not think you can overcome: if you want to produce an HTML version of your notebook, all the plots will become unusable because they will inserted in a much smaller scrollable plot pane.
On the other hand, if you choose PlutoPlotly.jl, you get rid off all the problems above and still get all the Plotly plotting capabilities in your notebook, with some extras added by its developer (@disberd).