【问题标题】:Unable to install devtools package on MacOS Mojave 10.14.6, R 3.5.1无法在 MacOS Mojave 10.14.6、R 3.5.1 上安装 devtools 包
【发布时间】:2020-03-06 09:50:58
【问题描述】:

我在 R 中安装 devtools 包时遇到问题,而且似乎在 Mac 上已经遇到过这个问题。 我正在使用命令行

install.packages(“devtools”)

但在尝试安装依赖项时总是会收到错误消息。

主要错误信息如下:

ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64:

configure: error: C compiler cannot create executables

ERROR: compilation failed for package ‘fs’

Warning in install.packages :
  installation of package ‘fs’ had non-zero exit status

checking whether the C compiler works... no

如果需要,我还可以放置整个错误消息。 最终导致未安装依赖项并且无法安装 devtools。

我已经尝试卸载 Xcode 并重新安装它,独立安装 CommandLineTool,独立安装依赖项。我检查了路径/Library/Developer/CommandLineTools/SDKs,其中包含MacOSX.sdk,但也包含MacOSX.sdk 1, MacOSX10.14.sdk and MacOSX10.15.sdk

【问题讨论】:

  • @roman-luštrik 我试过 xcode-select --install 但它已经安装了,我检查了 gcc 版本使用:gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 我尝试更新 gcc,安装 gcc5...

标签: r xcode macos devtools


【解决方案1】:

在全新安装 Catalina 之后,我终于设法安装了 devtools(我猜这适用于任何操作系统),然后它要求安装 Git,然后从 Xcode 更新命令行工具。之后我可以安装 devtools 和依赖项。但是,如果没有全新安装,我没有任何解决方案来解决问题。

【讨论】:

    猜你喜欢
    • 2020-12-10
    • 2020-05-30
    • 2021-04-16
    • 2020-02-11
    • 1970-01-01
    • 2019-09-01
    • 2019-03-27
    • 2019-12-22
    • 2019-12-25
    相关资源
    最近更新 更多