# PlotlyJS backend not working in Jupyter Notebook on VS Code

**URL:** <https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827>\
**Category:** Jupyter-Notebook\
**Tags:** vscode, plots, plotlyjs\
**Created:** [March 9, 2023, 10:15pm UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827 "2023-03-09T22:15:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![y0avd](https://avatars.discourse-cdn.com/v4/letter/y/8c91f0/32.png) [@y0avd](https://discourse.julialang.org/u/y0avd)\
**Post date:** [March 9, 2023, 10:15pm UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/1 "2023-03-09T22:15:05Z")

</div>

The following code:

`using Plots`  
`plotlyjs()`  
`plot(rand(10,4),rand(10,4),rand(10,4))`

Runs perfectly fine as a .jl in my vscode environment, but the same code just runs forever when inside of a Jupyter notebook in VS Code. Any ideas on how how to fix this?

IJulia v1.24.0  
Plotly v0.4.1  
PlotlyJS v0.18.10  
Plots v1.38.7

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [March 10, 2023, 8:33am UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/2 "2023-03-10T08:33:54Z")

</div>

Are you using the same Julia environment in both cases?

Can you run other commands in the Jupyter notebook?

---

<div class="post-metadata">

**Author:** ![y0avd](https://avatars.discourse-cdn.com/v4/letter/y/8c91f0/32.png) [@y0avd](https://discourse.julialang.org/u/y0avd)\
**Post date:** [March 11, 2023, 4:06am UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/3 "2023-03-11T04:06:32Z")

</div>

Yes, it’s the same environment. I have been using Jupyter for everything, and have yet to come across anything that doesn’t work in Jupyter but works in REPL.

---

<div class="post-metadata">

**Author:** ![dna100](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dna100/32/50227_2.png) [@dna100](https://discourse.julialang.org/u/dna100)\
**Post date:** [May 25, 2023, 10:35am UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/4 "2023-05-25T10:35:24Z")

</div>

I’ve had trouble getting plotlyjs() to run as the backend in VSCode Jupyter notebook. It does run from the REPL without issue.

My packages are:  
PlotlyJS v0.18.10  
Plots v1.38.12  
StatsPlots v0.15.5

I did have IJulia and Conda installed but couldn’t use plotlyhs at all in vscode jupyter. I removed those, and now on first load of VSCode, I can set plotlyjs() as the backend inside a jupyter notebook and plot with Plots (or StatsPlots). I can run as many plots as I like in the notebook. Once I close VSCode and reload later, plotlyjs() just runs forever and no plots show. If I reboot, and load VSCode, they’ll plot again until I close. Then I can’t plot until I reboot.

---

<div class="post-metadata">

**Author:** ![benz0li](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/benz0li/32/37040_2.png) [@benz0li](https://discourse.julialang.org/u/benz0li)\
**Post date:** [May 29, 2023, 6:50am UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/5 "2023-05-29T06:50:19Z")

</div>

This works fine on my _[reference deployment](https://demo.jupyter.b-data.ch)_ using the [JupyterLab Julia docker stack](https://github.com/b-data/jupyterlab-julia-docker-stack):

 ![plotlyjs](https://global.discourse-cdn.com/julialang/original/3X/d/9/d90492a33a3f086a91fb9481d2473da37bac680a.png)

* * *

OS: Debian 11 (bullseye), Architecture: x86\_64  
code-server v4.13.0 (aka Code v1.78.2)  
Code Jupyter extension v2023.3.100  
Code Julia extension v1.47.2  
Julia v1.9.0

IJulia v1.24.0  
PlotlyJS v0.18.10  
Plots v1.38.14

* * *

> **[GitHub - b-data/jupyterlab-julia-docker-stack: (GPU accelerated) Multi-arch...](https://github.com/b-data/jupyterlab-julia-docker-stack)**
>
> (GPU accelerated) Multi-arch (linux/amd64, linux/arm64/v8) docker images. Please submit Pull Requests to the GitLab repository. Mirror of - GitHub - b-data/jupyterlab-julia-docker-stack: (GPU accel...

What makes this project different:

1. Multi-arch: `linux/amd64`, `linux/arm64/v8`
2. Base image: [Debian](https://hub.docker.com/_/debian) instead of [Ubuntu](https://hub.docker.com/_/ubuntu)
3. IDE: [code-server](https://github.com/coder/code-server) next to [JupyterLab](https://github.com/jupyterlab/jupyterlab)
4. Just Python – no [Conda](https://github.com/conda/conda) / [Mamba](https://github.com/mamba-org/mamba)

---

<div class="post-metadata">

**Author:** ![Moslem\_Uddin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moslem_uddin/32/49483_2.png) [@Moslem\_Uddin](https://discourse.julialang.org/u/Moslem_Uddin)\
**Post date:** [June 5, 2023, 1:25am UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/6 "2023-06-05T01:25:21Z")

</div>

I’m also having the same issue. The following giving output in REFL

```julia
using Plots
plotlyjs()
plot(sin, (x->begin
            sin(2x)
        end), 0, 2π, line = 4, leg = false, fill = (0, :orange))

```

But in Jupyter Notebook it’s continuing to run on and if I interrupt the kernel it’s giving output.

I’m using Julia 1.9.0 and have the following packages.

[0c46a032] DifferentialEquations v7.7.0  
[28b8d3ca] GR v0.72.7  
[7073ff75] IJulia v1.24.2  
[f0f68f2c] PlotlyJS v0.18.10  
[91a5bcdd] Plots v1.38.15  
[f2b01f46] Roots v2.0.17

---

<div class="post-metadata">

**Author:** ![bobmccrory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bobmccrory/32/5137_2.png) [@bobmccrory](https://discourse.julialang.org/u/bobmccrory)\
**Post date:** [October 20, 2023, 4:42pm UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/7 "2023-10-20T16:42:29Z")

</div>

Apparently this issue hasn’t gone away. I’m using VSCode and the latest Julia version and packages as of 10/20/23: Julia 1.9.3, IJulia 1.24.2, PlotlyJS 0.18.11, and Plots 1.39.0. The using PlotlyJS statement never returns. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Post date:** [April 22, 2025, 7:46pm UTC](https://discourse.julialang.org/t/plotlyjs-backend-not-working-in-jupyter-notebook-on-vs-code/95827/8 "2025-04-22T19:46:40Z")

</div>

In Google Colab it doesn’t work either.
