# Problems to build GR

**URL:** <https://discourse.julialang.org/t/problems-to-build-gr/53981>\
**Category:** New to Julia\
**Created:** [January 26, 2021, 1:38pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981 "2021-01-26T13:38:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [January 26, 2021, 1:38pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/1 "2021-01-26T13:38:08Z")

</div>

Compiling `gr()` the core is not reset. The error is this:

```julia
using Plots
gr()
x=0:0.01:2*π
y=sin.(x)
plot(x,y)

```

```julia
SystemError: opening file "C:\\Users\\Usuário\\AppData\\Local\\Temp\\jl_lyXJ1gB2lS.svg": No such file or directory
systemerror(::String, ::Int32; extrainfo::Nothing) at error.jl:168
(::Base.var"#systemerror##kw")(::NamedTuple{(:extrainfo,),Tuple{Nothing}}, ::typeof(systemerror), ::String, ::Int32) at error.jl:168
(::Base.var"#systemerror##kw")(::NamedTuple{(:extrainfo,),Tuple{Nothing}}, ::typeof(systemerror), ::String) at error.jl:168
#systemerror#48 at error.jl:167 [inlined]
systemerror at error.jl:167 [inlined]
open(::String; lock::Bool, read::Bool, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at iostream.jl:284
open at iostream.jl:273 [inlined]
open(::String, ::String; lock::Bool) at iostream.jl:346
open at iostream.jl:346 [inlined]
_readfile(::String) at GR.jl:3342
show() at GR.jl:3401
plot_data(::Bool) at jlgr.jl:1380
plot_data at jlgr.jl:1061 [inlined]
plot(::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Vararg{Union{AbstractString, Function, AbstractArray{T,2} where T, AbstractArray{T,1} where T},N} where N; kv::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at jlgr.jl:1583
plot(::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Vararg{Union{AbstractString, Function, AbstractArray{T,2} where T, AbstractArray{T,1} where T},N} where N) at jlgr.jl:1575
plot(::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at GR.jl:3281
plot(::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Vararg{Any,N} where N) at GR.jl:3281
top-level scope at Manipulacoes.jl:26

```

Anyone may help me please?

---

<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:** [January 26, 2021, 1:58pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/2 "2021-01-26T13:58:15Z")

</div>

Could you please try the following:

```julia
using GR
x = 0:0.01:2*π
y = sin.(x)
plot(x, y)

```

… and then:

```julia
savefig("test.svg")

```

If this works, please quit Julia and then (in the `Command Prompt`) simply enter

```julia
test.svg

```

… which should display the above SVG file.

---

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [January 26, 2021, 2:10pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/3 "2021-01-26T14:10:18Z")

</div>

> [@jheinen](#):
>
> `savefig("test.svg")`

Thank for the comment.

When I enter:

```julia
savefig("test.svg")

```

the same error occurs:

```julia
SystemError: opening file "C:\\Users\\USURIO~2\\AppData\\Local\\Temp\\jl_2Z46m5cU4x.svg": No such file or directory
systemerror(::String, ::Int32; extrainfo::Nothing) at error.jl:168
(::Base.var"#systemerror##kw")(::NamedTuple{(:extrainfo,),Tuple{Nothing}}, ::typeof(systemerror), ::String, ::Int32) at error.jl:168
(::Base.var"#systemerror##kw")(::NamedTuple{(:extrainfo,),Tuple{Nothing}}, ::typeof(systemerror), ::String) at error.jl:168
#systemerror#48 at error.jl:167 [inlined]
systemerror at error.jl:167 [inlined]
open(::String; lock::Bool, read::Bool, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at iostream.jl:284
open at iostream.jl:273 [inlined]
open(::String, ::String; lock::Bool) at iostream.jl:346
open at iostream.jl:346 [inlined]
_readfile(::String) at GR.jl:3342
show() at GR.jl:3401
plot_data(::Bool) at jlgr.jl:1380
savefig(::String; kv::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at jlgr.jl:2429
savefig at jlgr.jl:2426 [inlined]
#savefig#26 at GR.jl:3316 [inlined]
savefig(::String) at GR.jl:3316
top-level scope at Manipulacoes.jl:27

```

Could you help me please?

---

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [January 26, 2021, 2:13pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/4 "2021-01-26T14:13:28Z")

</div>

> [@jheinen](#):
>
> `test.svg`

See below:

 ![svg](https://global.discourse-cdn.com/julialang/original/3X/f/f/ff9b617c5c6e053a6b5e949f35fb21ec2e4873d8.png)

---

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [January 26, 2021, 2:24pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/5 "2021-01-26T14:24:32Z")

</div>

In the Atom environment the error above appears.

However, when compile these codes in the executable, the graph is done, but an error appears:

```julia
julia> plot(x,y)
GKS: file open error (C:\Users\Usuário\.julia\packages\GR\yMV3y\src\..\deps\gr\FONTS\GKSFONT.DAT)
open: No such file or directory

julia> savefig("test.svg")
GKS: svgplugin.dll: can't load library, error 126 (0x7e)

```

See below:

 ![svg2](https://global.discourse-cdn.com/julialang/original/3X/6/7/674ce4092dc9c465cea4db36333261177aca40e4.png)

Almost there…

---

<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:** [January 26, 2021, 2:28pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/6 "2021-01-26T14:28:44Z")

</div>

The only explanation I have is, that there is a Unicode Problem with your account name. I could not reproduce it on Windows 10. Is there another account on your system (without UTF characters in the account name)?

 ![Screen Shot 2021-01-26 at 15.25.56](https://global.discourse-cdn.com/julialang/original/3X/a/6/a6b7d3a240150adb7c0144369267d54244e7b262.jpeg)

---

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [January 26, 2021, 2:32pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/7 "2021-01-26T14:32:39Z")

</div>

> [@angeloaliano1](#):
>
> `GKS: svgplugin.dll: can't load library, error 126 (0x7e)`

Do you think if I solve the unicode problem the problem is solved?

Is the folder name “Usário”? Do you know how to change it?

Is this related to the atom editor too?

---

<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:** [January 26, 2021, 2:44pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/8 "2021-01-26T14:44:02Z")

</div>

Could you please try `savefig("test.pdf")` and/or `savefig("test.png")`?

---

<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:** [January 26, 2021, 3:11pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/9 "2021-01-26T15:11:28Z")

</div>

That’s strange: The following script works fine on Windows:

```julia
using GR
plot(randn(10))
savefig("delta-Δ/pi-π.svg")

```

Somehow I am now at a loss …

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 26, 2021, 3:47pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/10 "2021-01-26T15:47:27Z")

</div>

@jheinen, fyi `savefig("delta.svg")` worked fine on Win10 Julia 1.6.0-beta1.0 but not with the special characters:

```julia
julia> savefig("delta-Δ/pi-π.svg")
GKS: file open error (delta-Δ/pi-π.svg)
open: No such file or directory
GKS: can't open SVG file
open: No such file or directory

```

---

<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:** [January 26, 2021, 4:26pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/11 "2021-01-26T16:26:09Z")

</div>

Does `savefig("pi-π.svg")` work? I don’t understand why it works on my Windows 10 VM - even on the C:\ device. So it’s not related to some special virtual files system …

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 26, 2021, 4:47pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/12 "2021-01-26T16:47:19Z")

</div>

@jheinen, yes `savefig("pi-π.svg")` does work. `savefig` is not supposed to create a new directory `delta-Δ/` if this does not exist.

---

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [January 26, 2021, 8:50pm UTC](https://discourse.julialang.org/t/problems-to-build-gr/53981/13 "2021-01-26T20:50:00Z")

</div>

The problem is actually the name of account name. I cannot change. There is a way to move the past `/.julia` to other local? I cannot to do this.
