关于在Julia中使用Plots包的问题

时间:2018-02-04 06:54:14

标签: julia packages ijulia-notebook plots.jl

我试图在Julia中使用Plots包但我收到一条错误消息,我不完全理解。使用Jupyter笔记本我遵循canonic方式安装和使用包:

Pkg.add("Plots")
using Plots

但是之后我收到了这条错误消息:

INFO: Precompiling module Plots.
WARNING: Module Compat with uuid 131681569370755 is missing from the cache.
This may mean module Compat does not support precompilation but is imported by a module that does.
ERROR: LoadError: Declaring __precompile__(false) is not allowed in files that are being precompiled.
Stacktrace:
 [1] _require(::Symbol) at .\loading.jl:455
 [2] require(::Symbol) at .\loading.jl:405
 [3] include_from_node1(::String) at .\loading.jl:576
 [4] include(::String) at .\sysimg.jl:14
 [5] anonymous at .\<missing>:2
while loading C:\Users\Alex\.julia\v0.6\StaticArrays\src\StaticArrays.jl, in expression starting on line 17
ERROR: LoadError: Failed to precompile StaticArrays to C:\Users\Alex\.julia\lib\v0.6\StaticArrays.ji.
Stacktrace:
 [1] compilecache(::String) at .\loading.jl:710
 [2] _require(::Symbol) at .\loading.jl:463
 [3] require(::Symbol) at .\loading.jl:405
 [4] include_from_node1(::String) at .\loading.jl:576
 [5] include(::String) at .\sysimg.jl:14
 [6] anonymous at .\<missing>:2
while loading C:\Users\Alex\.julia\v0.6\Plots\src\Plots.jl, in expression starting on line 7

Failed to precompile Plots to C:\Users\Alex\.julia\lib\v0.6\Plots.ji.

Stacktrace:
[1] compilecache(::String) at .\loading.jl:710
[2] _require(::Symbol) at .\loading.jl:497
[3] require(::Symbol) at .\loading.jl:405
[4] include_string(::String, ::String) at .\loading.jl:522

有人可以帮我理解这个错误,我该怎么办才能解决它?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

那是因为你在尝试更新之前已经在你的范围内使用了Compat。然后它有一个问题,即尝试使用新版本的Compat进行预编译,而旧版本仍然在范围内。要解决此问题,只需重新启动Julia并执行using Plots