gpt4 book ai didi

R Remote 包无法在慢速带宽上安装_github 公共(public) github 包

转载 作者:行者123 更新时间:2023-12-05 03:27:30 26 4
gpt4 key购买 nike

在使用 rocker/TidyVerse 基础镜像构建 docker 镜像期间,我正在努力安装公共(public) R 包 (140MB)。

我能够在快速互联网连接 (200Mbps) 上构建图像,但在 4Mbps 上挣扎

#11 687.2 The downloaded source packages are in
#11 687.2 ‘/tmp/Rtmpol4fiC/downloaded_packages’
#11 688.9 Downloading GitHub repo asgr/ProSpect@master
#11 748.8 Error in utils::download.file(url, path, method = method, quiet = quiet, :
#11 748.8 download from 'https://api.github.com/repos/asgr/ProSpect/tarball/master' failed
#11 749.1 Skipping install of 'Rfits' from a github remote, the SHA1 (7050c11a) has not changed since last install.
#11 749.1 Use `force = TRUE` to force installation
#11 749.4 Skipping install of 'ProFit' from a github remote, the SHA1 (3ad5fa18) has not changed since last install.
#11 749.4 Use `force = TRUE` to force installation
#11 749.7 * checking for file ‘/tmp/Rtmpol4fiC/remotes6494ed363/kateharborne-SimSpin-857278e/DESCRIPTION’ ... OK
#11 749.8 * preparing ‘SimSpin’:
#11 749.8 * checking DESCRIPTION meta-information ... OK
#11 749.8 * cleaning src
#11 749.9 * installing the package to process help pages
#11 750.3 -----------------------------------
#11 750.3 ERROR: dependency ‘ProSpect’ is not available for package ‘SimSpin’
#11 750.3 * removing ‘/tmp/RtmpUvUFDh/Rinsta8b47db6258/SimSpin’
#11 750.3 -----------------------------------
#11 750.3 ERROR: package installation failed
#11 750.5 Error: Failed to install 'SimSpin' from GitHub:
#11 750.5 System command 'R' failed, exit status: 1, stdout & stderr were printed
#11 750.5 Execution halted

我试过增加超时时间、指定下载方法 (libcurl)、首先安装有问题的包 (ProSpect),但都无济于事。有没有人看到类似的东西或有任何建议?这是从 github 以较慢的带宽下载 Remote (和 devtools)的一致问题。

# Dockerfile for R-based software (SimSpin)
#FROM rocker/r-ver:4.1.2
FROM rocker/tidyverse:4.0.2

RUN apt-get -y update && apt-get install -y xml2 openssl libhdf5-dev libfftw3-dev curl

RUN R -e 'install.packages("remotes")'
RUN R -e 'options(timeout=9999999)'
RUN R -e 'options(download.file.method = "libcurl")'
RUN R -e 'Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true")'
RUN R -e 'remotes::install_github("asgr/ProSpect", ref="master")'
RUN R -e 'remotes::install_github("kateharborne/SimSpin", ref="master")'

更新我已将其缩小为 remotes:install_github 连接速度慢(4Mbps 下载)的问题。我看不到如何配置绕过这个...(如果我在 40Mbps+ 上运行相同的安装,它安装没有问题,但是我不能一直访问该带宽)。

> remotes::install_github("kateharborne/SimSpin", ref="master")
Downloading GitHub repo kateharborne/SimSpin@master
Error in utils::download.file(url, path, method = method, quiet = quiet, :
download from 'https://api.github.com/repos/kateharborne/SimSpin/tarball/master' failed

最佳答案

如果你不使用 install_github 而克隆 repo a la:

git clone https://github.com/kateharborne/SimSpin
cd SimSpin

然后用

devtools::install()

另一种选择是为 download.file 设置超时选项,例如:

options(timeout=1000)

关于R Remote 包无法在慢速带宽上安装_github 公共(public) github 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71466840/

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