# Problems with GR.plot, but may be environment related

**URL:** <https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [December 18, 2019, 5:23am UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423 "2019-12-18T05:23:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrzej\_Ceglowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrzej_ceglowski/32/7869_2.png) [@Andrzej\_Ceglowski](https://discourse.julialang.org/u/Andrzej_Ceglowski)\
**Post date:** [December 18, 2019, 5:23am UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423/1 "2019-12-18T05:23:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [December 18, 2019, 6:52am UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423/2 "2019-12-18T06:52:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Andrzej\_Ceglowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrzej_ceglowski/32/7869_2.png) [@Andrzej\_Ceglowski](https://discourse.julialang.org/u/Andrzej_Ceglowski)\
**Post date:** [December 19, 2019, 12:01am UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423/3 "2019-12-19T00:01:43Z")

</div>

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?_

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [December 19, 2019, 7:41am UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423/4 "2019-12-19T07:41:01Z")

</div>

`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?

---

<div class="post-metadata">

**Author:** ![misha\_mikhasenko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/misha_mikhasenko/32/5060_2.png) [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Post date:** [April 27, 2021, 1:00pm UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423/5 "2021-04-27T13:00:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![misha\_mikhasenko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/misha_mikhasenko/32/5060_2.png) [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Post date:** [April 27, 2021, 2:19pm UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423/6 "2021-04-27T14:19:26Z")

</div>

UPD: Did not help

```julia
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`.
