That seems odd…
You’re using a notebook, which, Pluto?
I’m not on Windows (which I doubt is the problem, but can’t rule out), and I’m using the REPL, not a notebook, and I can plot with using your code, in 1.9.2. I could plot in a fraction of a second, for second plot, but it took a few seconds for the first…
(@v1.9) pkg> st
⌃ [13f3f980] CairoMakie v0.10.2
⌃ [e9467ef8] GLMakie v0.8.2
⌅ [20f20a25] MakieCore v0.6.2
[f0f68f2c] PlotlyJS v0.18.10
[91a5bcdd] Plots v1.38.17
Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`
The “⌃ and ⌅” need not be a problem, while ideally you don’t want to see them in front of the (plotting) packages you use, in this case PlotlyJS AND Plots). While [GL]Makie is a plotting package, it’s a different one, and you don’t need to see anything related to it, since you’re not using it, otherwise same advice would apply. In your case you would like Pluto and/or IPython or whatever you’re using to additionally be at the latest version. I tried installing them, and it worked, though I got a downgrade…:
⌅ [34da2185] ↓ Compat v4.9.0 ⇒ v3.46.2
This is considered ok to do for the package manager, since any combination of packages should be safe (and IPython insists), but that may not be the case…, and this is not a problem for IPython, but could be for other packages (if their Projects.toml file is wrong).
See below on possible segfault, that I encountered, and solution. What I did:
julia> using Plots; plotlyjs()
ERROR: ArgumentError: Package Plots not found in current path.
- Run `import Pkg; Pkg.add("Plots")` to install the Plots package.
I’m not sure why I got (an unrelated error, that could have been your issue for your relevant package, I have unusually large environment, but it still should have worked the first time around, compiling Makie):
julia> using PlotlyJS
│ Package PlotlyJS not found, but a package named PlotlyJS is available from a registry.
│ Install package?
│ (@v1.9) pkg> add PlotlyJS
└ (y/n/o) [y]: y
Resolving package versions...
Installed WebSockets ──────────── v1.6.0
Installed PlotlyBase ──────────── v0.8.19
Installed Kaleido_jll ─────────── v0.2.1+0
Installed Mustache ────────────── v1.0.17
Installed Blink ───────────────── v0.12.8
Installed FunctionalCollections ─ v0.5.0
Installed Widgets ─────────────── v0.6.6
Installed WebIO ───────────────── v0.8.21
Installed JSExpr ──────────────── v0.5.4
Installed PlotlyJS ────────────── v0.18.10
Downloaded artifact: plotly-base-artifacts
Downloaded artifact: web
Downloaded artifact: electronjs_app
Downloaded artifact: plotly-artifacts
Downloaded artifact: Kaleido
[f0f68f2c] + PlotlyJS v0.18.10
[bf4720bc] + AssetRegistry v0.1.0
[ad839575] + Blink v0.12.8
[de31a74c] + FunctionalCollections v0.5.0
[9fb69e20] + Hiccup v0.2.2
[97c1335a] + JSExpr v0.5.4
[50d2b5c4] + Lazy v0.15.1
[ffc61752] + Mustache v1.0.17
[a975b10e] + Mux v1.0.1
[d96e819e] + Parameters v0.12.3
[a03496cd] + PlotlyBase v0.8.19
[f0f68f2c] + PlotlyJS v0.18.10
[3a884ed6] + UnPack v1.0.2
[0f1e0344] + WebIO v0.8.21
[104b5d7c] + WebSockets v1.6.0
[cc8bc4a8] + Widgets v0.6.6
[f7e6163d] + Kaleido_jll v0.2.1+0
Building WebIO ───→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/0eef0765186f7452e52236fa42ca8c9b3c11c6e3/build.log`
Building PlotlyJS → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/7452869933cd5af22f59557390674e8679ab2338/build.log`
43 dependencies successfully precompiled in 297 seconds. 264 already precompiled.
1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version
Segmentation fault (core dumped)
As you see there “✓ Plots” Plots was precompiled for me. And I believe I saw Makie after that being precompiled, and I suppose it didn’t finish precompiling, possibly it was buggy in the old version (I’ve never before had a segfault while precompiling, though I often get OOM because of parallel precompilation, so I frequently CTRL-C to stop it, I didn’t in this case).
Without working on fixing that (likely or potential problem), plotting with the other, what you are using, worked for me.
If you had gotten a segfault for Plots or PlotlyJS for some reason (running out of memory should not be it), then I wouldn’t expect that package, or any relevant it happened to to succeed.
I did this since I got a segfault (and didn’t see it again, so I suppose Makie would work if I would test it), also to updated versions just in case:
(@v1.9) pkg> up
[13f3f980] ↑ CairoMakie v0.10.2 ⇒ v0.10.8
[e9467ef8] ↑ GLMakie v0.8.2 ⇒ v0.8.8
[c43c736e] ↑ Genie v5.15.0 ⇒ v5.18.1
[20f20a25] ↑ MakieCore v0.6.2 ⇒ v0.6.5
[6099a3de] ↑ PythonCall v0.9.12 ⇒ v0.9.14
[621f4979] ↑ AbstractFFTs v1.3.0 ⇒ v1.5.0
Progress [========================================>] 269/272
The spinner before make didn’t copy-paste correctly, eventually it went away, and was replaced by:
this finished successfully with:
272 dependencies successfully precompiled in 370 seconds. 79 already precompiled.
112 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
2 dependencies had warnings during precompilation:
┌ micromamba_jll [f8abcde7-e9b7-5caa-b8af-a437887ae8e4]
│ Downloading artifact: micromamba
┌ MKL_jll [856f044c-d86e-5d09-b602-aeab76dc8ba7]
│ Downloading artifact: MKL
[ Info: We haven't cleaned this depot up for a bit, running Pkg.gc()...
Active manifest files: 13 found
Active artifact files: 218 found
Active scratchspaces: 23 found
Deleted 86 package installations (175.134 MiB)
Deleted 7 repos (366.037 KiB)
Deleted 7 artifact installations (206.124 MiB)
Deleted 48 scratchspaces (7.631 KiB)