Closed charliekirkwood closed 3 years ago
This is explained in the 'Non-Exportable Objects' vignette (https://cran.r-project.org/web/packages/future/vignettes/future-4-non-exportable-objects.html). There's no solution to this.
Here's a minimal reproducible example:
library(reticulate)
library(future)
plan(multisession, workers = 2)
np <- import("numpy")
f <- future(np$sqrt(x))
value(f)
## Error in withCallingHandlers({ : attempt to apply non-function
Ok thanks for the clarification
Hi thanks for the great package, I'm wondering if there is a way to expose python functions (imported into the main R session using reticulate) to the parallel workers of future.apply in order to avoid 'attempt to apply non-function' errors?
Reproducible examples below (borrowed from your own example on stack overflow) - the first one works, the second one doesn't despite working for standard lapply: