Problems to build GR

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

using Plots
gr()
x=0:0.01:2*π
y=sin.(x)
plot(x,y)
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?

Could you please try the following:

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

… and then:

savefig("test.svg")

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

test.svg

… which should display the above SVG file.

Thank for the comment.

When I enter:

savefig("test.svg")

the same error occurs:

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?

See below:

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> 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:

Almost there…

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

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?

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

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

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

Somehow I am now at a loss …

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

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

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 …

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

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.