Open chengmingbo opened 9 months ago
Thanks for raising this issue. As you explained, this look like insufficient isolation of the container from the main system and R config referring to the host home directory.
In our case (I suspect) there is no issue because '~/R/x86_64-pc-linux-gnu-library/4.1'
simply does not exist (both on the host and container), thus .libPaths() looks like this:
> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
And indeed once loaded this is where the relevant pacakges are located (shortened output):
> devtools::session_info()
...
- Packages -------------------------------------------------------------------
package * version date lib source
devtools 2.4.2 2021-06-07 [1] CRAN (R 4.1.0)
dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.1.0)
markdown * 1.1 2019-08-07 [1] CRAN (R 4.1.0)
[1] /usr/local/lib/R/site-library
[2] /usr/lib/R/site-library
[3] /usr/lib/R/library
I am wondering if this could be easily fixed by removing (or renaming) the "/home/mingbo/R/x86_64-pc-linux-gnu-library/4.1"
on your host or running the container in an environment without R installation.
I am surprised though that manually specifying .libPaths
does not fix your problem.
Does this apply to any package or just the knitr:spin
function?
If you specify the .libPaths can you run library(dplyr)
? If this is the case you may still be able to run the necessary code, you may just not be able to "spin" and generate a report.
Hi there, Great paper, great singularity image! I'm not familiar with singularity, it might be my issue.
I tried the singularity image but failed. When I started a container using shell and go into the R prompt
I got the wrong R library paths which I think shouldn't be from the host.
No package can be loaded successfully, e.g.:
I think it's because the
Renviron
refers a host directory in the file/usr/lib/R/etc/Renviron
Where
R_LIB_USER
is setting isOn the other hand, even I tried a hotfix by setting libPaths to add in the front
I still got the error message: