作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在使用 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/
我是一名优秀的程序员,十分优秀!