gpt4 book ai didi

r - 如何调试安装R包失败?

转载 作者:行者123 更新时间:2023-12-02 18:52:19 25 4
gpt4 key购买 nike

我正在尝试通过JupyterLab启动并在Alpine Linux docker镜像中运行的Jupyter笔记本中安装CRAN软件包(从镜像),并且大多数使用conda安装。一些软件包可以工作...

install.packages('ABCanalysis', verbose=TRUE, INSTALL_opts=c('--debug'), repos=...)

...输出...
system (cmd0): /opt/conda/lib/R/bin/R CMD INSTALL --debug 
also installing the dependency 'plotrix'

foundpkgs: plotrix, ABCanalysis, /tmp/RtmpqoorrU/downloaded_packages/plotrix_3.7-4.tar.gz, /tmp/RtmpqoorrU/downloaded_packages/ABCanalysis_1.2.1.tar.gz
files: /tmp/RtmpqoorrU/downloaded_packages/plotrix_3.7-4.tar.gz,
/tmp/RtmpqoorrU/downloaded_packages/ABCanalysis_1.2.1.tar.gz
1): succeeded '/opt/conda/lib/R/bin/R CMD INSTALL --debug -l '/opt/conda/lib/R/library' /tmp/RtmpqoorrU/downloaded_packages/plotrix_3.7-4.tar.gz'
2): succeeded '/opt/conda/lib/R/bin/R CMD INSTALL --debug -l '/opt/conda/lib/R/library' /tmp/RtmpqoorrU/downloaded_packages/ABCanalysis_1.2.1.tar.gz'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

install.packages('bitops', verbose=TRUE, INSTALL_opts=c('--debug'), repos=...)

...但是有些包裹没有...
install.packages('bitops', verbose=TRUE, INSTALL_opts=c('--debug'), repos=...)

system (cmd0): /opt/conda/lib/R/bin/R CMD INSTALL --debug
foundpkgs: bitops, /tmp/RtmpqoorrU/downloaded_packages/bitops_1.0-6.tar.gz
files: /tmp/RtmpqoorrU/downloaded_packages/bitops_1.0-6.tar.gz
Warning message in install.packages("bitops", verbose = TRUE, INSTALL_opts = c("--debug"), :
"installation of package 'bitops' had non-zero exit status"Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

我怀疑但不确定,那些不需要编译工作的软件包和那些不需要编译工作的软件包都不需要。

如何调试该代码,即如何发现导致非零退出代码的原因? --debugverbose似乎都没有显示出任何有用的信息。

最佳答案

使用keep_outputs = TRUE,即

install.packages('bitops', keep_outputs = TRUE, repos=...)

这会将安装的输出保存到当前工作目录中名为 bitops.out的文件中。

关于r - 如何调试安装R包失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54268403/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com