# PlotlyJS causes errors, can't figure out how to use PlotlyLight - how to use Plotly from Julia?

**URL:** <https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853>\
**Category:** New to Julia\
**Tags:** plotlyjs\
**Created:** [January 16, 2024, 4:57am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853 "2024-01-16T04:57:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 16, 2024, 4:57am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/1 "2024-01-16T04:57:59Z")

</div>

First post, new to Julia coming from Matlab, so please bear with me, I seem to be struggling with the most basic stuff.

After lots of reading, it seems PlotlyJS is the best plotting package for my use case: interactive exploration of large data sets, mainly time series with datetime x axes (so no Makie for me, I don’t really feel like setting my x ticks manually).

I installed PlotlyJS on a brand new Julia 1.10, and I get an error saying:  
`Warning: Kaleido is not available on this system. Julia will be unable to save images of any plots`  
and then  
`Warning: ErrorException("Could not start Kaleido process")`  
So as far as I understand, I won’t be able to save any SVG.  
I can plot, and the plot is very responsive with large time series, I can also save an HTML file and use the camera button to download a PNG, but that’s not a solution for publication-quality figures.

Searching for documentation, it seems that problems with Kaleido have been present for a long time, with plenty of contradictory information found on forums, so I thought perhaps I should try PlotlyLight (not really knowing whether that would change anything with saving figures).

I installed the PlotlyLight package, and copy/pasted the tutorial found here: [GitHub - JuliaComputing/PlotlyLight.jl: Plotly.js via Julia made easy.](https://github.com/JuliaComputing/PlotlyLight.jl)  
I get an error saying Plot() is not defined, or not correctly used, or I don’t know.  
Am I missing something obvious?

Thanks for any help!

PS. By the way the link to “export figures” from [Home · PlotlyJS](http://juliaplots.org/PlotlyJS.jl/stable/) is dead, and it is not immediately obvious (to me) that the instructions to save figures are hidden under a menu item called “working with plots”.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 16, 2024, 7:41am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/2 "2024-01-16T07:41:15Z")

</div>

> [@jojob68](#):
>
> Am I missing something obvious?

No, you don’t.  
I tried installing PlotlyJS and got no errors and examples and savefig work, so I failed to reproduce your errors. PlotlyLight gave me errors after I had to install PlotlyKaleido but the errors seem to different from yours.  
I suggest that we go back:

```julia
(@v1.10) pkg> rm PlotlyLight PlotlyKaleido
...

```

and try to identify your PlotlyJS problems.  
What system do you have:

```julia
julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, haswell)
  Threads: 5 on 8 virtual cores

```

Package status seems to be not a problem, as you say you started with a clean Julia 1.10. but perhaps you give too:

```julia
(@v1.10) pkg> st
...

```

You are right here:

> [@jojob68](#):
>
> PS. By the way the link to “export figures” from [Home · PlotlyJS](http://juliaplots.org/PlotlyJS.jl/stable/) is dead, and it is not immediately obvious (to me) that the instructions to save figures are hidden under a menu item called “working with plots”.

You may consider to open an issue at [Issues · JuliaPlots/PlotlyJS.jl · GitHub](https://github.com/JuliaPlots/PlotlyJS.jl/issues) or even better try to make a PR by editing the docs [PlotlyJS.jl/docs/src/index.md at master · JuliaPlots/PlotlyJS.jl · GitHub](https://github.com/JuliaPlots/PlotlyJS.jl/blob/master/docs/src/index.md)

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [January 16, 2024, 12:50pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/3 "2024-01-16T12:50:10Z")

</div>

@jojob68 , welcome.

What editor are you using: VScode, Pluto, or any other?

There is no problem with plotting with PlotlyJS.jl if you use this package inside the VScode editor. If you type and run sequentially:

```julia
using PlotlyJS
aa=plot(randn(300))
savefig(aa, "aa.png")

```

the plot will first appear on the monitor, and then you can save it as you wish (PNG, PDF, SVG,…)

If you use Pluto.jl (a Julia package itself and a remarkable IDE), you should not use PlotlyJS.jl directly; otherwise, you will get the usual Kaleido problems. In Pluto, if you want to plot with the functionalities of PlotlyJS.jl, it would be best if you used PlotlyBase.jl instead, which is the partner of PlotlyJS that, in fact, renders the plots created by the former. For more details on how to use PlotlyJS.jl inside Pluto, check this thread [Cannot use PlotlyJS](https://discourse.julialang.org/t/cannot-use-plotlyjs/105057/5) .

Finally, if you want to use PlotlyJS and not bother about what IDE you should use, you can use PlutoPlotly.jl, a package developed by @disberd that mimics the functionalities of PlotlyJS and always works out of the box.

I do a lot of plotting using the functionalities of PlotlyJS.jl and it do not regret it. It is a wonderful package.

---

<div class="post-metadata">

**Author:** ![stephancb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephancb/32/14243_2.png) [@stephancb](https://discourse.julialang.org/u/stephancb)\
**Post date:** [January 16, 2024, 1:57pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/5 "2024-01-16T13:57:21Z")

</div>

Both, PlotlyJS and PlotlyLite work for me in the REPL. With PlotlyJS it is `plot(...)`, and with PlotlyLite `Plot(...)`. You need to start the Kaleido server.

```julia
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.0 (2023-12-25)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using PlotlyJS
Precompiling PlotlyJS
  6 dependencies successfully precompiled in 7 seconds. 69 already precompiled.

julia> p=plot(x, cos.(x))

julia> x=0:π/56:2π
0.0:0.05609986881410345:6.283185307179586

julia> p=plot(x, cos.(x))
[ Info: Listening on: 127.0.0.1:2228, thread id: 2

julia> savefig(p, "tmp/testplot.svg"; width=1280,height=800)
"tmp/testplot.svg"

```

and

```julia
              _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.0 (2023-12-25)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using PlotlyLight,PlotlyKaleido

julia> PlotlyKaleido.start(mathjax=true)

julia> x=0:π/56:2π
0.0:0.05609986881410345:6.283185307179586

julia> p=Plot(;x=x, y=cos.(x), type="scatter");

julia> savefig(p, "tmp/testplot.svg"; width=1280,height=800)
"tmp/testplot.svg"

```

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 16, 2024, 6:25pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/6 "2024-01-16T18:25:25Z")

</div>

Thank you for the answers. I use VSCode, but the error using PlotlyJS is the same when I just open a REPL and try using PlotlyJS.

Here are the versioninfo and package status. Sorry I can’t find a way to not remove libe breaks…

julia\> versioninfo() Julia Version 1.10.0 Commit 3120989f39 (2023-12-25 18:01 UTC) Build Info: Official [https://julialang.org/](https://julialang.org/) release Platform Info: OS: Windows (x86\_64-w64-mingw32) CPU: 12 × 13th Gen Intel(R) Core™ i7-1365U WORD\_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, goldmont) Threads: 1 on 12 virtual cores

Package status:

[336ed68f] CSV v0.10.12 [13f3f980] CairoMakie v0.11.5 [8be319e6] Chain v0.5.0 [35d6a980] ColorSchemes v3.24.0 [5ae59095] Colors v0.12.10 [a93c6f00] DataFrames v1.6.1 [1313f7d8] DataFramesMeta v0.14.1 [e9467ef8] GLMakie v0.9.5 [5903a43b] Infiltrator v1.6.4 [a98d9a8b] Interpolations v0.15.1 [b964fa9f] LaTeXStrings v1.3.1 ⌃ [8913a72c] NonlinearSolve v0.3.22 [9b87118b] PackageCompiler v2.1.17 [f0f68f2c] PlotlyJS v0.18.11 [08abe8d2] PrettyTables v2.3.1 [92933f4c] ProgressMeter v1.9.0 [295af30f] Revise v3.5.13 [40c74d1a] TableView v0.7.2 [f269a46b] TimeZones v1.13.0 [1986cc42] Unitful v1.19.0 [fdbf4ff8] XLSX v0.10.1 [ade2ca70] Dates

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 16, 2024, 7:06pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/7 "2024-01-16T19:06:43Z")

</div>

> [@jojob68](#):
>
> Sorry I can’t find a way to not remove libe breaks…

Just format it as code in between ``` like:

```julia
` ` `
bla
` ` `

```

without spaces between the ` .

Lets make sure that you have read and execution rights in artifacts. Please open a windows CMD shell, just type cmd at Start and run it.  
Move to `.julia`:

```julia
cd c:\users\Oli\.julia

```

Use your username instead if `Oli`, because thats me 😉

Run the following command:

```julia
icacls artifacts /grant everyone:(OI)(CI)RX /C /T

```

Depending on your language setting `everyone` needs to be something else, for me, german, its `jeder`. If you don’t find the right thing you can use your username too, like `Oli` in my case, perhaps its better anyways, so:

```julia
icacls artifacts /grant Oli:(OI)(CI)RX /C /T

```

This grants recursively read and exec rights to everything in folder artifacts, so you can be sure that you are allowed to run the `kaleido.exe` which is located on my system in `c:\Users\Oli\.julia\artifacts\7914a56da888d6a06d00c87f97e873c60e97acc7\bin\kaleido.exe`  
You can locate your path and apply above command just to the folder `7914a56da888d6a06d00c87f97e873c60e97acc7` in my case.

Perhaps `PlotlyJS` is good now.

Depending on your windows skill you are ok with this help. If not just ask and we see whats wrong.

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [January 16, 2024, 8:43pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/8 "2024-01-16T20:43:28Z")

</div>

I use PlotlyJS v0.18.12, and Julia v1.10.0 on a Windows 10 machine. No problem with my plotting using PlotlyJS in either the REPL or VScode. In the REPL this is what I get:

 ![z](https://global.discourse-cdn.com/julialang/original/3X/7/8/7853dc86138b05a84794edefd243968e601b9e3d.png)

You have a lot of packages in the main environment. Maybe, some package precludes you from updating PlotlyJS to the latest version. Your version is v0.18.11 while the latest one is v0.18.12. Can you try to update PlotlyJS and see what you get by doing in Julia mode:

```julia
import Pkg
Pkg.update("PlotlyJS")

```

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 16, 2024, 11:51pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/9 "2024-01-16T23:51:13Z")

</div>

Thanks for the suggestions. I ran the command to change access rights, it made no difference.  
I then updated all packages, it did find PlotlyJS 0.18.12 (which is very recent, since I installed the former version 2 days ago!) and installed it. Again, no difference, same error.  
I assume this is normal, but out of curiosity I tried to run `kaleido.cmd` which is in the artifacts directeory and it gives this error:

```julia
[0116/184426.256:WARNING:resource_bundle.cc(405)] locale_file_path.empty() for locale
[0116/184426.310:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir.
{"code": 1, "message": "No Scope Specified", "result": null, "version": "0.2.1"}

```

If there is a chance it can work by deleting julia entirely and reinstalling, this time with PlotlyJS 0.18.12 directly (and not upgrading from 0.18.11), I am willing to try, but this will take quite a bit of time so other suggestions are welcome.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 17, 2024, 8:20am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/10 "2024-01-17T08:20:48Z")

</div>

> [@jojob68](#):
>
> If there is a chance it can work by deleting julia entirely and reinstalling

I don’t think so.  
I check for the new error and will be back.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 17, 2024, 8:24am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/11 "2024-01-17T08:24:34Z")

</div>

> [@jojob68](#):
>
> gives this error:
> 
> ```julia
> [0116/184426.256:WARNING:resource_bundle.cc(405)] locale_file_path.empty() for locale
> [0116/184426.310:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir.
> {"code": 1, "message": "No Scope Specified", "result": null, "version": "0.2.1"}
> 
> ```

I get the same error in a CMD shell but PlotlyJS works for me.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 17, 2024, 8:45am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/12 "2024-01-17T08:45:01Z")

</div>

> [@jojob68](#):
>
> I tried to run `kaleido.cmd`

Could you please try again in the following way:

First we need the complete path to kaleido\_jll:

```julia
julia> using PlotlyJS.Kaleido_jll

julia> Kaleido_jll.artifact_dir
"C:\\Users\\Oli\\.julia\\artifacts\\7914a56da888d6a06d00c87f97e873c60e97acc7"

```

Now run in CMD (with your path of course):

```julia
C:\\Users\\Oli\\.julia\\artifacts\\7914a56da888d6a06d00c87f97e873c60e97acc7\\kaleido.cmd plotly --disable-gpu --no-sandbox

```

This is the command constructed in `kaleido.jl`.  
I have to stop the running process with Ctrl-C and I get the output:

```julia
[0117/094045.973:WARNING:resource_bundle.cc(405)] locale_file_path.empty() for locale
[0117/094046.001:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir.
{"code": 0, "message": "Success", "result": null, "version": "0.2.1"}
[0117/094046.031:ERROR:gpu_init.cc(430)] Passthrough is not supported, GL is swiftshader
^CBatchvorgang abbrechen (J/N)? J

```

Please report your output with your complete command line your are running. I have a suspicion.

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 17, 2024, 6:28pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/13 "2024-01-17T18:28:58Z")

</div>

Thank you for your continued effort to help!

I ran the command, and I got an “access denied” error. I then re-ran the command to change permissions that you recommended before, and it gave a different result.  
So I have to correct my statement above that " I ran the command to change access rights, it made no difference." I think what happened is that I didn’t copy/paste the last switch(es) /C /T, so the command ran without an error but didn’t do much. This time, when I ran it again, I got a long list of files for which the access rights were changed. I apologize for my error and the misleading statement.

But I still need help, because the only difference with the “corrected” access rights is that now, `using PlotlyJS` results in Julia hanging (I let is run for a full minute) and if I interrupt (CTRL-C) I get the same error as before about Kaleido not being available.

Running the command you suggest (C:\Users.…\kaleido.cmd plotly --disable-gpu --no-sandbox) gives this:

```julia
[0117/132424.316:WARNING:resource_bundle.cc(405)] locale_file_path.empty() for locale
[0117/132424.332:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir.
{"code": 0, "message": "Success", "result": null, "version": "0.2.1"}
[0117/132424.354:ERROR:gpu_init.cc(430)] Passthrough is not supported, GL is swiftshader
^CTerminate batch job (Y/N)? y

```

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 17, 2024, 8:03pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/14 "2024-01-17T20:03:11Z")

</div>

“Just hanging” is worse than before…

Running `kaleido.cmd` is now fine, good, some success.

It still may be something with your rights perhaps it’s the rights of the whole `.julia` folder. Typically the access rights in `artifacts` is inherited from the parent folder.

So lets do it again for `.julia` but now with write access too (full access), that’s how it should be in your home folder:

```julia
icacls .julia /grant YOUR_NAME:(OI)(CI)F /C /T

```

What’s your username? It’s no problem to tell us. If you don’t like: does it contain spaces or other special characters?

After changing the access rights, you may also try to reinstall, because perhaps some installations went wrong or partially wrong without proper access rights in `.julia`. But don’t delete `.julia`, like to be clean, because the access rights might be wrong again later on.

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 17, 2024, 9:46pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/15 "2024-01-17T21:46:53Z")

</div>

I changed the rights on the whole .julia folder, it took a while to run and said `successfully processed 78022 files; Failed processing 0 files`.  
After that, `using PlotlyJS` still hangs. One thing I didn’t notice before, it only hangs the first time. If I run `using PlotlyJS` again without restarting Julia, it completes immediately. But `savefig()` to a png fails (does work to HTML)  
My username is 3 letters like yours, no spaces no accents nothing special. And I am an administrator on the machine (but I still got the “access denied” when trying to run the .cmd the first time, so you were on to something…)  
I will try reinstalling Julia from scratch, but just to make sure, here is what I would do:

- uninstall Julia from Windows “add or remove programs”
- delete the contents of .julia under my username, but keep the folder itself.
- reinstall Julia

Is that the idea?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 17, 2024, 9:58pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/16 "2024-01-17T21:58:18Z")

</div>

> [@jojob68](#):
>
> Is that the idea?

Yes.

> [@jojob68](#):
>
> delete the contents of .julia under my username, but keep the folder itself.

But only if you really are new to Julia. E.g. the `.julia\dev` folder is important not to delete, as it holds your development environments, which typically don’t want to be lost. But I think you said you started from scratch, so it should be fine.

When you deinstalled and removed everything you may consider to install Julia using `juliaup`. You can get it from the Windows Store (just search for Julia). It helps a lot in the longer run. See [GitHub - JuliaLang/juliaup: Julia installer and version multiplexer](https://github.com/JuliaLang/juliaup) for installation and how to proceed. It should be no difference for the PlotlyJS problem.

Going to bed now, back in ~10h.

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 17, 2024, 10:59pm UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/17 "2024-01-17T22:59:31Z")

</div>

Willl try, thanks!

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 18, 2024, 12:21am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/18 "2024-01-18T00:21:56Z")

</div>

> [@stephancb](#):
>
> `PlotlyKaleido.start(mathjax=true)`

When I do this I get immediately an error:

```julia
julia> PlotlyKaleido.start(mathjax=true)                                                                                                                                                                                          
ERROR: Kaleido startup failed.                                                                                                                                                                                                    
Stacktrace:                                                                                                                                                                                                                       
 [1] error(s::String)                                                                                                                                                                                                             
   @ Base .\error.jl:35                                                                                                                                                                                                           
 [2] start(; plotly_version::Missing, mathjax::Bool, mathjax_version::VersionNumber, kwargs::@Kwargs{})                                                                                                                           
   @ PlotlyKaleido C:\Users\pkonl\SublimeJulia_1_10_0\assets\.julia-1.10.0-depot\packages\PlotlyKaleido\FXxni\src\PlotlyKaleido.jl:92                                                                                             
 [3] top-level scope                                                                                                                                                                                                              
   @ REPL[9]:1      

```

I think it is broken on windows with Julia 1.10.

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 18, 2024, 12:58am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/19 "2024-01-18T00:58:32Z")

</div>

> [@oheil](#):
>
> After changing the access rights, you may also try to reinstall, because perhaps some installations went wrong or partially wrong without proper access rights in `.julia`. But don’t delete `.julia`, like to be clean, because the access rights might be wrong again later on.

Thanks again for your help. I am pleased to report that I was finally able to save a PlotlyJS figure as svg, after this:

1. Uninstall Julia and delete .julia folder manually (I know you said not, but I was curious to see whether that really made a difference…)
2. Install Julia 1.10 from the Windows 64 installer
3. Add PlotlyJS (as the **only** package I added, right in the main @v1.10 environment)
4. Change the permissions on the artifacts folder with the instruction (in Windows CMD, not in Julia):  
`icacls C:\Users\%UserName%\.julia\7914a56da888d6a06d00c87f97e873c60e97acc7 /grant %UserName%:(OI)(CI)RX /C /T`  
(the `79..acc7` directory is the one where `kaleido.cmd` can be found)

After step 3, I was getting the same error as before. After changing the permissions according to your instructions, it worked. Compared to my previous attempt, the difference is in other packages that I had installed (in a somewhat random order, so I would not be able to reproduce that). So either I am missing something, or the hanging was caused by some other package?

---

<div class="post-metadata">

**Author:** ![jojob68](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jojob68](https://discourse.julialang.org/u/jojob68)\
**Post date:** [January 18, 2024, 3:34am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/20 "2024-01-18T03:34:36Z")

</div>

I wanted to try to find which package was causing a conflict, and I found something else that could be interesting. I did exactly the same steps as above, but this time, before adding PlotlyJS (as the very first package added to a clean setup) I created a shared @tmp environment (because I thought this would not “pollute” my main installation and I could do multiple attempts). What I got is this:

1. clean julia install 1.10 from windows 64 installer
2. activate @tmp environment, add PlotlyJS to that environment
3. try using PlotlyJS, I get the (now usual) error, so I change the permissions as instructed by oheil and restart Julia.
4. Now, after activating @tmp, using PlotlyJS hangs

Why is there a difference whether I install PlotlyJS in the main environment compared to when I install it in a @tmp environment?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 18, 2024, 8:04am UTC](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853/21 "2024-01-18T08:04:32Z")

</div>

> [@PetrKryslUCSD](#):
>
> I think it is broken on windows with Julia 1.10.

It works for me without any issues (Julia 1.10, Windows 11 (at home) and Windows 10 (work)).

> [@jojob68](#):
>
> I am pleased to report that I was finally able to save a PlotlyJS figure as svg

Awesome!

> [@jojob68](#):
>
> Why is there a difference whether I install PlotlyJS in the main environment compared to when I install it in a @tmp environment?

For me there is no difference, it just works in both scenarios.

Still I believe there is an access right problem inherited from your home directory. I recommend, to avoid similar future problems with other packages, to set “full access” at least to the `.julia` folder with above command (which enables inheritance for everything new beneath `.julia`. The command is:

```julia
icacls .julia /grant YOUR_NAME:(OI)(CI)F /C /T

```

[Next page](https://discourse.julialang.org/t/plotlyjs-causes-errors-cant-figure-out-how-to-use-plotlylight-how-to-use-plotly-from-julia/108853.md?page=2)
