WIN10 julia-1.6.1 使用Plots包plot()时报错

在提问之前请确定你已经努力阅读了文档,并且尝试自己在互联网上搜索。

请尽可能提供你的demo代码或者GitHub的gist地址。

# code
using Plots
x=1:10
y=rand(10)
plot(x,y)

出现以下报错,请大神帮忙看看Grisu 是什么?怎么解决
julia> plot(y)
Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: UndefVarError: Grisu not defined
Stacktrace:
[1] getproperty
@ .\Base.jl:26 [inlined]
[2] plain_precision_heuristic(xs::Vector{Float64})
@ Showoff C:\Users\Administrator.julia\packages\Showoff\RaPxi\src\Showoff.j
l:84
[3] showoff(xs::Vector{Float64}, style::Symbol)
@ Showoff C:\Users\Administrator.julia\packages\Showoff\RaPxi\src\Showoff.j
l:117
[4] optimal_ticks_and_labels(sp::Plots.Subplot{Plots.GRBackend}, axis::Plots.A
xis, ticks::Nothing)
@ Plots C:\Users\Administrator.julia\packages\Plots\6RLiv\src\axes.jl:185
[5] optimal_ticks_and_labels
@ C:\Users\Administrator.julia\packages\Plots\6RLiv\src\axes.jl:127 [inline
d]
[6] get_ticks(sp::Plots.Subplot{Plots.GRBackend}, axis::Plots.Axis)
@ Plots C:\Users\Administrator.julia\packages\Plots\6RLiv\src\axes.jl:231
[7] _update_min_padding!(sp::Plots.Subplot{Plots.GRBackend})
@ Plots C:\Users\Administrator.julia\packages\Plots\6RLiv\src\backends\gr.j
l:898
[8] iterate
@ .\generator.jl:47 [inlined]
[9] _collect(c::Matrix{AbstractLayout}, itr::Base.Generator{Matrix{AbstractLay
out}, typeof(Plots._update_min_padding!)}, #unused#::Base.EltypeUnknown, isz::Ba
se.HasShape{2})
@ Base .\array.jl:691
[10] collect_similar
@ .\array.jl:606 [inlined]
[11] map
@ .\abstractarray.jl:2294 [inlined]
[12] _update_min_padding!(layout::Plots.GridLayout)
@ Plots C:\Users\Administrator.julia\packages\Plots\6RLiv\src\layouts.jl:31
0
[13] prepare_output(plt::Plots.Plot{Plots.GRBackend})
@ Plots C:\Users\Administrator.julia\packages\Plots\6RLiv\src\plot.jl:184
[14] display(#unused#::Plots.PlotsDisplay, plt::Plots.Plot{Plots.GRBackend})
@ Plots C:\Users\Administrator.julia\packages\Plots\6RLiv\src\output.jl:149

[15] display(x::Any)
@ Base.Multimedia .\multimedia.jl:328
[16] #invokelatest#2
@ .\essentials.jl:708 [inlined]
[17] invokelatest
@ .\essentials.jl:706 [inlined]
[18] print_response(errio::IO, response::Any, show_value::Bool, have_color::Boo
l, specialdisplay::Union{Nothing, AbstractDisplay})
@ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\RE
PL\src\REPL.jl:247
[19] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::A
ny)
@ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\RE
PL\src\REPL.jl:231
[20] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
@ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\RE
PL\src\REPL.jl:462
[21] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, h
ave_color::Bool)
@ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\RE
PL\src\REPL.jl:229
[22] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL
, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.L
ineEdit.MIState, buf::Any, ok::Bool)
@ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\RE
PL\src\REPL.jl:798
[23] #invokelatest#2
@ .\essentials.jl:708 [inlined]
[24] invokelatest
@ .\essentials.jl:706 [inlined]
[25] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.Moda
lInterface, s::REPL.LineEdit.MIState)
@ REPL.LineEdit C:\buildbot\worker\package_win64\build\usr\share\julia\stdli
b\v1.6\REPL\src\LineEdit.jl:2441
[26] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
@ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\RE
PL\src\REPL.jl:1126
[27] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
@ REPL .\task.jl:411

终于找解决了,是bfsu的镜像有问题,取消JULIA_PKG_SERVER环境变量,再等凌晨外网不堵时重新安装julia和库,就正常了

备案号:京ICP备17009874号-2