【问题标题】:"installation of package ‘tidyverse’ had non-zero exit status" on MacOSMacOS 上的“安装包‘tidyverse’的退出状态非零”
【发布时间】:2020-02-08 04:46:53
【问题描述】:

我主要使用 Python 进行数据分析,但我也在尝试学习 R 统计数据。 Python、Pandas 等通过 Anaconda 安装在我的 Mac 笔记本电脑上。

今天我将 R Studio 下载到我的笔记本电脑上,并尝试运行 install.packages("tidyverse") 以开始使用 R。我遇到了这个错误:

ERROR: dependencies ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

在谷歌上搜索了一段时间后,我遇到了这个exactsimilar 问题的几个实例。但是,这些解决方案不适用于 Mac,例如,

sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev

原来 Anaconda 已经为我安装了 libcurllibxml2openssl。有没有办法让 Rstudio ......“看”(?)......对于 Anaconda 安装它们所需的编译库?

【问题讨论】:

    标签: macos anaconda rstudio


    【解决方案1】:

    如果您知道库在哪里(比如/my/lib/path),那么您可以使用withr::with_makevars 来补充库搜索路径。类似的东西

    library(withr)
    
    with_makevars(c(PKG_LIBS="-L/my/lib/path"), install.packages("tidyverse"), assignment="+=")
    

    就个人而言,我会尝试将其限制为仅 tidyverse 中失败的特定包,而不是整个伞包。

    【讨论】:

      猜你喜欢
      • 2019-01-14
      • 1970-01-01
      • 1970-01-01
      • 2017-09-21
      • 2019-03-03
      • 2021-04-17
      • 1970-01-01
      • 1970-01-01
      • 2016-03-16
      相关资源
      最近更新 更多