gpt4 book ai didi

r - 通过 devtools install_github 安装 r 包时出现问题

转载 作者:行者123 更新时间:2023-12-02 00:06:08 28 4
gpt4 key购买 nike

我正在 GitHub 上开发两个包,并尝试使用 devtools::install_github() 命令安装它们。

由于存储库是私有(private)的,我为我的帐户创建了一个 auth_token (据我所知,没有办法为单个存储库执行此操作?)

devtools::install_github("mariodejung/rMQanalysis", 
auth_token="6cd2dbe8bd1f062842b90afXXXXXXXXXXXXXXXXX",
ref="develop",
dependencies=TRUE)
devtools::install_github("mariodejung/cfpscripts",
auth_token="6cd2dbe8bd1f062842b90afXXXXXXXXXXXXXXXXX",
ref="develop")

第一个软件包的安装按预期进行,第二个软件包开始安装,但因错误而停止,并且出于某种原因它提到了第一个已安装的软件包。错误见文末评论。我不知道为什么会发生这种情况以及如何解决。

I added the error message below again since I changed some things already.

抱歉更改了 auth_token,但该脚本目前应保持私有(private)。

我还检查了仅使用一个命令安装这两个软件包,但它会导致相同的错误消息。我还按照评论中的建议在我的环境中添加了 GITHUB_PAT 变量,以免公开使用身份验证 token 。

devtools::install_github(c("mariodejung/rMQanalysis","mariodejung/cfpscripts"), 
ref="develop",
dependencies=TRUE)

此命令现在可以成功安装 rMQanalysis 软件包,但在安装 cfpscripts 时失败并显示相同的错误消息。仍然不知道如何找出问题所在。它适用于其他机器。还安装了所有依赖项。

devtools::install_github(c("mariodejung/rMQanalysis","mariodejung/cfpscripts"), ref='develop', quiet=FALSE)
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo mariodejung/rMQanalysis@develop
from URL https://api.github.com/repos/mariodejung/rMQanalysis/zipball/develop
Installing rMQanalysis
"C:/PROGRA~1/R/R-32~1.5/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/cfproteomics/AppData/Local/Temp/RtmpktvmUK/devtools43850da641a/mariodejung-rMQanalysis-0e38dd3463ea830b19f0afa2ade6f2e14db93041" \
--library="C:/Users/cfproteomics/Documents/R/win-library/3.2" --install-tests

* installing *source* package 'rMQanalysis' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
No man pages found in package 'rMQanalysis'
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (rMQanalysis)
Downloading GitHub repo mariodejung/cfpscripts@develop
from URL https://api.github.com/repos/mariodejung/cfpscripts/zipball/develop
Installing cfpscripts
Downloading GitHub repo mariodejung/rMQanalysis@develop
from URL https://api.github.com/repos/mariodejung/rMQanalysis/zipball/develop
Error in stop(github_error(request)) : Not Found (404)

我还使用了 traceback() 函数,但它没有提供更多见解...

15: stop(github_error(request))
14: download_github(dest, src, auth)
13: remote_download.github_remote(remote, quiet = quiet)
12: remote_download(remote, quiet = quiet)
11: FUN(X[[i]], ...)
10: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
9: install_remotes(object$remote[behind], ..., quiet = quiet)
8: update.package_deps(pkg, ..., Ncpus = threads, quiet = quiet,
upgrade = upgrade)
7: update(pkg, ..., Ncpus = threads, quiet = quiet, upgrade = upgrade)
6: install_deps(pkg, dependencies = initial_deps, upgrade = upgrade_dependencies,
threads = threads, force_deps = force_deps, quiet = quiet,
...)
5: install(source, ..., quiet = quiet, metadata = metadata)
4: FUN(X[[i]], ...)
3: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
2: install_remotes(remotes, quiet = quiet, ...)
1: devtools::install_github(c("mariodejung/rMQanalysis", "mariodejung/cfpscripts"),
ref = "develop", quiet = FALSE)

更新2

整个问题似乎是 devtools 1.12.0 中的一个错误。它在 1.11.1 中运行良好。
我发现,我的 rMQanalysis 包在 cfpscripts 中被提到为 Imports:。如果我从 Description 中删除此 Imports: 语句,则该包安装正常。
我仍然想知道,为什么我不能设置 dependency=FALSE 来阻止 install_github 安装依赖包。

我已经填写了关于 devtools 的错误报告但还没有反应。

最佳答案

您是否尝试过下载或克隆存储库[因为您已付费]并从源代码安装?

install.packages("/Path/to/source", repos=NULL, type="source")

关于r - 通过 devtools install_github 安装 r 包时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39657795/

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