错误:找不到构建dplyr所需的构建工具

时间:2016-01-29 23:58:26

标签: r dplyr

我正在尝试从其存储库安装dplyr,但是我收到以下错误。 我正在使用MBP与Yosemite和Xcode 6.2(它有点过时)。我发现这很好奇,显然,这不是一个常见问题,因为我没有在此错误消息上找到任何线程。我想知道我在这里缺少什么构建工具。

> devtools::install_github("hadley/dplyr")
Downloading GitHub repo hadley/dplyr@master
from URL https://api.github.com/repos/hadley/dplyr/zipball/master
Error: Could not find build tools necessary to build dplyr

当我尝试从本地安装软件包时,这是我从终端收到的错误:

clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -DPLATFORM_PKGTYPE='"mac.binary.mavericks"'    -fPIC  -Wall -mtune=core2 -g -O2  -c pause.c -o pause.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/X11/lib -L/usr/local/lib /usr/local/lib/libcairo.a /usr/local/lib/libpixman-1.a /usr/local/lib/libfreetype.a /usr/local/lib/libfontconfig.a -lxml2 /usr/local/lib/libreadline.a -o profvis.so pause.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
clang: error: no such file or directory: '/usr/local/lib/libreadline.a'

3 个答案:

答案 0 :(得分:1)

您可以转到此address下载并安装较新版本的命令行工具以及@alistaire提到的XCode,但您拥有的那个很好。

根据您发布的消息,它表明存在链接问题。您想为readline lib创建符号链接。 Homebrew为我们这样做,但由于某种原因,它没有;因此,您可以通过使用--force选项手动创建链接来解决此问题:

brew link readline --force

答案 1 :(得分:0)

作为一个GNU项目,R可能习惯于使用GNU工具和GCC编译器套件。我建议您通过Homebrew下载标准编译器和GNU coreutilshttps://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/

libreadline也是一个GNU库,所以我假设如果你不通过包管理器获得GNU库和实用工具,你可能会遇到更多问题。

答案 2 :(得分:0)

我刚刚安装了Xcode,在macOS Sierra下遇到了这个问题。

我去检查我是否正确安装了gcc C编译器,所以输入了

gcc --version

这导致了错误消息

xcrun: error: active developer path ("/Users/richierocks/Downloads/Xcode-beta.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.

我打字

sudo xcode-select --switch /Applications/Xcode.app/

然后我输入了我的macOS密码。

在此之后,安装dplyr正常工作。

相关问题