小编mdu*_*ska的帖子

使用 devtools::install_github() 安装无法检测到构建工具

这是我第一次尝试下载 Github 包,在 MacOS Big Sur v11.2.1 上使用 RStudio v1.2.5033 时遇到了一些问题。

最初,当运行

library(devtools)
devtools::install_github('xuyiqing/gsynth')
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Warning in install.packages :
  installation of package ‘gsynth’ had non-zero exit status
Run Code Online (Sandbox Code Playgroud)

看了一些资料,看来我需要下载命令行工具,所以我下载了 XCode CLI、clang4 和 gfortran。现在我收到一条弹出消息:

“从源代码安装构建工具构建 R 包需要安装额外的构建工具。你想现在安装额外的工具吗?是/否”

如果我单击“否”,则会收到此错误:

Error: Failed to install 'gsynth' from GitHub:
  Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
Run Code Online (Sandbox Code Playgroud)

在 R 控制台中运行上面的 pkgbuild 代码,这就是我得到的:

Trying to compile a simple C file
Error: Could not find tools necessary to compile …
Run Code Online (Sandbox Code Playgroud)

r github devtools

6
推荐指数
1
解决办法
901
查看次数

标签 统计

devtools ×1

github ×1

r ×1