在之前的工作中,我使用“reticulate”包在 R 中运行 Autogluon autoML 库。该代码在我当前的配置(Ubuntu 20.4、R 4.10、reticulate v.125)中运行良好。
然而,这段代码在 Docker 中不起作用。
FROM rocker/r-ver:4.1.0
## Install R packages
RUN R -q -e 'install.packages("remotes")'
RUN R -q -e 'remotes::install_github("rstudio/reticulate")'
# Install Autogluon
RUN R -q -e 'reticulate::install_miniconda()'
RUN R -q -e 'reticulate::conda_create(envname = "r-autogluon", packages = c("python=3.8.13", "numpy"))'
# RUN R -q -e 'reticulate::conda_list()'
RUN R -q -e 'reticulate::conda_install(envname = "r-autogluon", packages = "autogluon", pip = TRUE)'
RUN R -e 'reticulate::use_condaenv("r-autogluon", required = TRUE)'
# RUN -q -e 'reticulate::py_config()'
EXPOSE …Run Code Online (Sandbox Code Playgroud)