UnPack does not work in DrWatson on a different machine

I am using DrWatson to run simulations.
I wrote everything on my machine and now I am trying to run it on a cluster.
I have copied the Project folder and activated and instantiated the Project on the new machine.
However, I run into an annoying problem.
I have a function to actually run the simulation like they propose on the doc

function makesim(d::Dict)
    @unpack a, b, v, method = d
    r, y = fakesim(a, b, v, method)
    fulld = copy(d)
    fulld[:r] = r
    fulld[:y] = y
    return fulld
end

The problem is that the @unpack macro does not work on the other machine.
I tried to simply use it on the REPL and it works fine. So I can’t understand what is the problem when using it in the simulation script.

This is the error I get

ERROR: LoadError: LoadError: LoadError: UndefVarError: @unpack not defined
Stacktrace:
 [1] top-level scope
 [2] #macroexpand#36 at ./expr.jl:108 [inlined]
 [3] macroexpand at ./expr.jl:107 [inlined]
 [4] docm(::LineNumberNode, ::Module, ::Any, ::Any, ::Bool) at ./docs/Docs.jl:521 (repeats 2 times)
 [5] @doc(::LineNumberNode, ::Module, ::String, ::Vararg{Any,N} where N) at ./boot.jl:464
 [6] include(::Function, ::Module, ::String) at ./Base.jl:380
 [7] include(::Module, ::String) at ./Base.jl:368
 [8] exec_options(::Base.JLOptions) at ./client.jl:296
 [9] _start() at ./client.jl:506

First thing I would check is that

is installed, and you are using it.

2 Likes

I was thinking that DrWatson was including it for me. That is how it was working on my machine.
But I ended up installing it independently on the second machine, and then using it, and now it works fine.