Key BlackBoxOptim not found

Hello,
I am examining the parallel computing speed in BlackBoxOptim by optimizing the Rosebrock function using codes adapted from rosenbrock_parallel.jl by @robertfeldt. The code I run is as follows:

using Distributed
@everywhere using CSV
@everywhere using Tables
@everywhere using BlackBoxOptim
for i = 1:56
  addprocs(1)
  println("Number of workers: ", nworkers())
  opt = bbsetup(BlackBoxOptim.rosenbrock; SearchRange = (-5.0, 5.0), Workers = workers(), NumDimensions = 20000, MaxFuncEvals = 10, TraceMode = :silent)
  el = @elapsed res = bboptimize(opt)
  t = round(el, digits=3)
  v = [i; t]
  println("workers: "v[1], "; time: ", v[2])
end

I encounter the following error message:

KeyError: key BlackBoxOptim [a134a8b2-14d6-55f6-9291-3336d3ab0209] not found

Could anyone tell me how to fix it? Thanks so much!

I think I have found the solution. The addprocs() function should be placed before loading all the other packages, so instead of putting the other packages outside the loop, my code should be like:

using Distributed
for i = 1:56
  addprocs(1)
    @everywhere using CSV
    @everywhere using Tables
    @everywhere using BlackBoxOptim
  println("Number of workers: ", nworkers())
  opt = bbsetup(BlackBoxOptim.rosenbrock; SearchRange = (-5.0, 5.0), Workers = workers(), NumDimensions = 20000, MaxFuncEvals = 10, TraceMode = :silent)
  el = @elapsed res = bboptimize(opt)
  t = round(el, digits=3)
  v = [i; t]
  println("workers: "v[1], "; time: ", v[2])
end