# Plotly causes WebIO error in Julia Notebook

**URL:** https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918
**Category:** General Usage
**Created:** [February 14, 2025, 6:07pm UTC](https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918 "2025-02-14T18:07:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![decuser](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/decuser/32/215233_2.png) [@decuser](https://discourse.julialang.org/u/decuser)
#### Post date: [February 14, 2025, 6:07pm UTC](https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918/1 "2025-02-14T18:07:03Z")

</div>

When I try to use Plotly in Julia Notebook, I get the following error:

```julia
WebIO not detected.

Please read the troubleshooting guide for more information on how to resolve this issue.

https://juliagizmos.github.io/WebIO.jl/latest/troubleshooting/not-detected/

```

Here is the process I used to install julia and configure:

```julia
python -m venv julia
source julia/bin/activate
python -m pip install --upgrade pip
python -m pip install jupyter jupyterlab webio_jupyter_extension

curl -fsSL https://install.julialang.org | sh -s -- --default-channel=lts

julia
julia> using Pkg
julia> pkg"add IJulia"
julia> pkg"add Plotly"
julia> using IJulia
julia> notebook()

```

Then in the notebook:

```julia
using Plotly
my_plot = plot([scatter(x=[1,2], y=[3,4])], Layout(title="My plot"))

```

This is when I get the error mentioned above. I have tried a couple different versions of python and julia… 1.11.3 has an issue building WebIO, so I am using LTS here. Any help appreciated.

---

<div class="post-metadata">

### Author: ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)
#### Post date: [February 14, 2025, 8:20pm UTC](https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918/2 "2025-02-14T20:20:07Z")

</div>

I would suggest to try using directly PlotlyLight.jl or PlotlyBase.jl if you just want to use it in jupyter as you don’t definitely need the WebIO part in jupyter and that is the cause of most problems with PlotlyJS and derivatives…

---

<div class="post-metadata">

### Author: ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)
#### Post date: [March 10, 2025, 9:32pm UTC](https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918/3 "2025-03-10T21:32:54Z")

</div>

Could you please give an example of plot using only PlotlyBase, not PlotlyJS. It is of interest for google colab where I don’t know how to install a webio extension.

---

<div class="post-metadata">

### Author: ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)
#### Post date: [March 11, 2025, 8:50am UTC](https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918/4 "2025-03-11T08:50:09Z")

</div>

Hi @empet, it seems there was a bug introduced in the display method within IJulia when the PlotlyBase IJulia extension was added.  
I filed a PR [here](https://github.com/sglyon/PlotlyBase.jl/pull/117) but you should be able to fix this in the notebook itself thanks to `@eval` while waiting for the PR (or any alternative fix) to be merged and published:

You can check an example colab notebook with fix [at this link](https://colab.research.google.com/drive/1Ehx_z35JqmwjvqN3ZxupyxynziqHzE2y?usp=sharing)

Edit:  
Here is also the snippet of code to evaluate in the notebook assuming you have `using PlotlyBase` in another cell:

```julia
@eval IJulia function display_dict(p::$Plot)
    Dict(
        "application/vnd.plotly.v1+json" => $PlotlyBase.JSON.lower(p),
        "text/plain" => sprint(show, "text/plain", p),
        "text/html" => let
            buf = IOBuffer()
            show(buf, MIME("text/html"), p)
            String(take!(buf))
        end
    )
end

```

---

<div class="post-metadata">

### Author: ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)
#### Post date: [April 26, 2025, 7:23am UTC](https://discourse.julialang.org/t/plotly-causes-webio-error-in-julia-notebook/125918/5 "2025-04-26T07:23:41Z")

</div>

Just an update on this subject.  
The PR was merged and released as part of PlotlyBase v0.8.21, so the hack with `@eval` is not needed anymore and now PlotlyBase by itself should display fine in jupyter and colab 🙂
