Package 'future' is not installed on worker [when .libPaths() contains backslashes] #566
-
Move from #532 (comment) to here, where @michalovadek asked the following:
and:
Next stepsThere is something that causes your parallel workers not to see your What does the following output for you: library(parallelly)
cl <- makeClusterPSOCK(1L, dryrun = TRUE) and then: library(parallel)
library(parallelly)
cl <- makeClusterPSOCK(1L)
print(.libPaths())
print(clusterEvalQ(cl, .libPaths())) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
the first output: "C:/PROGRA~1/R/R-41~1.1/bin/x64/Rscript" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "options(socketOptions = \"no-delay\")" -e "workRSOCK <- tryCatch(parallel:::.workRSOCK, error=function(e) parallel:::.slaveRSOCK); workRSOCK()" MASTER=localhost PORT=11556 OUT=/dev/null TIMEOUT=2592000 XDR=FALSE SETUPTIMEOUT=120 SETUPSTRATEGY=sequential the second output is identical for both print calls:
|
Beta Was this translation helpful? Give feedback.
-
Good. So, I would expect the following to actually work; please confirm: library(parallel)
library(parallelly)
cl <- makeClusterPSOCK(1L)
print(clusterEvalQ(cl, library("future"))) Next, let's verify that also the following works: library(future)
cl <- parallelly::makeClusterPSOCK(1L)
plan(cluster, workers = cl)
f <- future(library("future"))
v <- value(f)
print(v) If this works, what is the output if you do: library(future)
plan(multisession, workers = 2L, dryrun=TRUE) It will produce an error;
but I'm interested in the lines before that. It'll contain info on something like PS. Please format your code blocks here in GitHub using Markdown code blocks to make it easier to read. I did that for your most recent comment. |
Beta Was this translation helpful? Give feedback.
-
Good. Yes, that warning is expected and can be ignored. I suspect the problem is with the:
part, which I think should be
That is, some of those backslashes are dropped. I'll have to look into this and I'd imagine this has to be fixed in parallelly. For now, I think the following is a workaround that should work for you: library(future)
plan(multisession, workers = 2L, rscript_libs = NULL)
f <- future(42)
v <- value(f)
print(v) Does that work? |
Beta Was this translation helpful? Give feedback.
-
Can you try with parallelly 1.29.0-9004; remotes::install_github("HenrikBengtsson/parallelly", ref="develop") ? I think it fixes it so that you can do: library(future)
plan(multisession, workers = 2L)
f <- future(42)
v <- value(f)
print(v) as expected. |
Beta Was this translation helpful? Give feedback.
-
FYI, parallelly 1.30.0, which fixes this bug, is now on CRAN. |
Beta Was this translation helpful? Give feedback.
Can you try with parallelly 1.29.0-9004;
? I think it fixes it so that you can do:
as expected.