gpt4 book ai didi

github - 使用 install_github 在分支上安装包时出错

转载 作者:行者123 更新时间:2023-12-02 05:04:14 25 4
gpt4 key购买 nike

我从 github fork 了一个包并做了一些更改。我正在尝试安装已使用 install_github() 进行更改的软件包版本,但收到错误消息。有什么建议吗?

fork 版本:https://github.com/embruna/refnet

分支上编辑后的版本:https://github.com/embruna/refnet/tree/proposed-updates

我可以安装 fork 版本:

install_github("embruna/refnet", subdir="pkg")

我尝试使用以下命令在分支上安装该版本:

install_github("embruna/refnet@proposed-updates", subdir="pkg")

但随后出现此错误:

** help
*** installing help indices
** building package indices
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 1 did not have 6 elements
ERROR: installing package indices failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/refnet’
Error: Command failed (1)

感谢您的任何建议。

编辑:有两个问题:1)我使用的 install_github 语法不正确,2)“pkg”中有一个文件夹即使在更正语法后也会抛出错误。详情请参阅下文。

最佳答案

我猜测使用 @ 指定分支,但使用 subdir 参数指定子目录会使 devtools 感到困惑。

这对我有用(在 repo 参数中指定子目录和分支):

install_github("embruna/refnet/pkg@proposed-updates",

这也是如此(将分支和子目录指定为单独的参数):

devtools::install_github("embruna/refnet",
ref = "proposed-updates", subdir = "pkg")

输出以这种方式开始...

Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo embruna/refnet@proposed-updates
from URL https://api.github.com/repos/embruna/refnet/zipball/proposed-updates
Installing refnet

这是使用 devtools 1.12.0

关于github - 使用 install_github 在分支上安装包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41623049/

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