`@everywhere` running `using` and `imports` first means you can't do `using Pkg; Pkg.activate(".")` first before `using MyPkg` for local `MyPkg` #42085
If your workers are called via SSHManager, you could perhaps activate the environment via environment variables or command-line arguments, e.g. by passing one of these keyword parameter to addprocs:
When using
Distributed
and loading packages on workers that include local packages in development , one might want to do something like:where
MyPkg
is a local package in the current directory. However, since@everywhere
movesusing MyPkg
abovePkg.activate(".")
(see below) https://github.com/JuliaLang/julia/blob/a11de31665d46b63fe1ff043d056c3c5483afdc6/stdlib/Distributed/src/macros.jl#L204 this doesn't work and one is required to use two separate@everywhere
blocks.