Problems with GR.plot, but may be environment related

After an Atom restart I cannot get plots to run without error messages.

The following REPL code and errors are indicative:

julia> plot(rand(10))
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: SystemError: opening file “C:\Users\xxx\AppData\Local\Temp\jl_97E5.tmp.png”: No such file or directory

Windows OS (10). Julia 1.2. Atom 1.42.0 64

I did the following:
Pkg.update(“GR”)
Pkg.update(“Plots”)
ENV[“GRDIR”]=""
Pkg.build(“GR”)

This got rid of the following error:
ERROR: error compiling _plot!: error compiling _display: could not load library “libGR.dll”
The specified module could not be found.
but replaced with the opening file error.

Is this a permissions/path/settings error?
How do I solve it?

What’s the result of ENV["GRDIR"] after using GR. Does this directory exist and contain the missing DLL (libGR.dll)?

Hi,
Thank you for the reply.
Yes the file libGR.dll exists in the Windows path: C:\Users\xxx.julia\packages\GR\oiZD3\deps\gr\bin.

I have plots running now. Here’s what I did:

I shut down Atom.
I started the Julia REPL.
I ran a plot command and got a Windows security warning about the software trying to write to an unauthorised location.
I approved the override of security (my user account has appropriate authorisation rights).
The plot proceeded as expected, with a pop-up window displaying the image.

I then closed the Julia REPL, opened Atom and then the plot commands functioned as expected.

I guess that Atom suppressed the Windows warning messages, so I couldn’t override them.

So the error I reported related to environment issues relating to Windows, rather than GR.

The long term solution would be to set the path for the temp plots to the user root directory, rather than AppData. Where/how can this be done?

TMPDIR is currently set to C:\\Users\\%USERNAME%\\AppData\\Local\\Temp in Windows. I’m not a Windows expert - what would be a proper path?

I have the same problem when trying to run julia script.jl from julia command run(`python script.py`) that starts julia inside. Trying to change ENV[“TMP”] now to a local scope - It is just a guess that run has some scope restrictions

UPD: Did not help

ERROR: LoadError: LoadError: SystemError: opening file "C:\\Users\\xxx\\.julia\\dev\\myProject\\TMP\\jl_Aef3QHFj8W.pdf": No such file or directory

jl_Aef3QHFj8W.svg file is there, pdf is missing.

UPD2: Fixed by updating GR.