VS Code 1.7.1.2 and Plots.jl not working

I have Julia 1.8.1 installed, and the August 2022 update (1.7.2) of VS Code; the latest at the time of writing.

Loading the REPL from the command line, the follow code works:

using Pkg; Pkg.add(“Plots”); using Plots; plot([1.0])

In the latest VS Code I get the following error:

GKS: svgplugin.dll: can’t load library, error 126 (0x7e)
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: SystemError: opening file “C:\Users\leather\AppData\Local\Tem\jl_qtCZMTaVsX.svg”: No such file or directory

I’ve deleted my ‘.julia’ directory and rebuilt the Plots.jl package to no avail.

Any ideas what could be the culprit?

3 Likes

Since yesterday I have the same problem. It has something to with the way vs code displays plots in its own plot plane. When I uncheck the “use plot plane” option in vscode for julia it works fine. However, I have no idea how to fix this.

1 Like

I’m getting

GKS: svgplugin.dll: can't load library, error 126 (0x7e)
Error showing value of type Plots.Plot{Plots.GRBackend}:

SYSTEM (REPL): showing an error caused an error

SYSTEM (REPL): caught exception of type ErrorException while trying to handle a nested exception; giving up

while trying to plot while using the REPL in VSCode. I’m using Julia v1.8.1 and Plots v1.34.3.

Note that plotting using the REPL outside VSCode works fine.

Edit: adding the GR package, changed the error to

Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: SystemError: opening file "C:\\Users\\Niky\\AppData\\Local\\Temp\\jl_sH8pMPANER.svg": No such file or directory
1 Like

Plots.jl already has GR.jl as a dependency, so you shouldn’t need to add it. I guess that could be a clue. I would first confirm Julia 1.8.1 works in the REPL, as it does for me. I’m not on Windows in case it’s a Windows problem, but I suspect a simple PATH problem in VS Code, or it using an older Julia version or something.

1 Like
1 Like

I’ve just tagged Plots@1.34.4: it will be out soon (<10m) once New version: Plots v1.34.4 by JuliaRegistrator · Pull Request #69200 · JuliaRegistries/General · GitHub is merged and it should fix VSCode for Windows users.

Please upgrade to Plots@1.34.4 and ensure GR@0.68 is in the manifest:

(@v1.8) pkg> status -m GR
⌃ [28b8d3ca] GR v0.68.0
4 Likes

Version 1.34.4 of Plots fixed this problem for me. Thank you!

Ditto!

Plots@1.35.0 has just been released.

@jheinen has manually tested vscode on windows with GR@0.69, in addition to CI being :heavy_check_mark: for all julia versions and OSs.

This should be a transparent transition for all users, especially on windows.

In the (unlikely ?) case of failure, please report the issue asap.

2 Likes

I have this issue since today. In Julia 1.8.1, 1.8.2, 1.6.7. Plots v1.35.7, GR v0.69.5 How to solve it?

Solved it like this: Plots v1.34.1 - Cannot Precompile in new project environment · Issue #4375 · JuliaPlots/Plots.jl · GitHub

I have the same problem with Plots v1.35.7.

I also have the problem in a temporary environment with only Plots v1.34.4 loaded. GR v0.68.0 is in the manifest. The Julia version is 1.8.1, Everything worked fine until yesterday. Other backends I tried like PlotlyJS and PyPlot did not have this problem.

julia> Plots.plot([1,2,3])
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: SystemError: opening file "C:\\Users\\fsald\\AppData\\Local\\Temp\\jl_uBahyN6ZOd.svg": No such file or directory

Plots.jl, GR.jl broken due to GR_jll v0.69.1+1.
GKS: svgplugin.dll: can't load library, error 126 (0x7e) · Issue #486 · jheinen/GR.jl · GitHub.

@mkitti, I was afraid of this, and I can’t afford to spend a whole day on this.

Should we release a new GR.jl with with GR_jll pinned now ?

EDIT: yanked GR_jll instead, pkg> up should solve the issue.

1 Like

In the next version of the GR run-time you may enable debug output (using GR_DEBUG and/or GKS_DEBUG environment variables). Hopefully, we can then find the cause of the problem(s).

@mkitti : Thanks again for your contributions. I still have the impression that the cause of the problems described here is I/O related.

1 Like

Please see my explanation here: