【问题标题】:Errors building R-packages for conda为 conda 构建 R 包时出错
【发布时间】:2016-08-07 15:57:52
【问题描述】:

我很难安装 Anaconda 存储库中不可用的 R 包。到目前为止,我的尝试可以在这里找到How to install R-packages not in the conda repositories?

目前,我正在尝试按照标题构建 conda R 包this article 的说明为 conda 构建 R 包 rafalib

第一部分效果很好。

conda skeleton cran rafalib

输出:

Tip: install CacheControl to cache the CRAN metadata
Fetching metadata from http://cran.r-project.org/
Writing recipe for rafalib
Done

构建命令遇到错误

conda build r-rafalib

输出:

Removing old build environment
Removing old work directory
BUILD START: r-rafalib-1.0.0-r3.2.2_0
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .
Error:  Packages missing in current linux-64 channels: 
  - r 3.2.2*
  - r-rcolorbrewer

我通过conda 安装了r 3.2.2-64bit,它运行没有问题。我也已经通过conda 安装了r-colorbrewer,我可以在R 中使用该软件包而不会出现问题。为什么在尝试构建conda 软件包时会出现这些错误?

我使用的是内核 4.4.5-1-ARCH 的 Linux(Antergos,Arch 衍生产品)。


2015 年 4 月 19 日更新

感谢this answer,我发现我可以通过在与我要安装的包相同的目录中单独构建它们来包含依赖项。这对我不起作用,但我还读到我可以使用-c 在构建命令中包含一个频道,就像安装时一样。所以现在我这样做了:

conda build -c r r-rafalib

这解决了所有的依赖问题,但是在获取、提取和链接包之后,它失败了。错误信息到此结束。

Removing old work directory
Source cache directory is: /home/joel/anaconda2/conda-bld/src_cache
Downloading source to cache: rafalib_1.0.0.tar.gz
Downloading http://cran.r-project.org/src/contrib/rafalib_1.0.0.tar.gz
rafalib_1.0.0. 100% |#######################| Time: 0:00:00   4.87 MB/s
Success
Extracting download
Package: r-rafalib-1.0.0-r3.2.2_0
source tree in: /home/joel/anaconda2/conda-bld/work/rafalib
+ mv DESCRIPTION DESCRIPTION.old
+ grep -v '^Priority: ' DESCRIPTION.old
+ /home/joel/anaconda2/envs/_build/bin/R CMD INSTALL --build .
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Command failed: /bin/bash -x -e /home/joel/drafts/r-rafalib/build.sh

错误sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook和我在使用install.packages()as reported here时遇到的一样。

有一些related discussion in this thread。我试图通过安装不同版本的 ncurses 来解决这个错误,包括this patched version,并且我试图链接 readline 库,as suggested here,但我一直遇到同样的错误。在这一点上我很迷茫,如果能帮助解决这个问题,我将不胜感激。

【问题讨论】:

  • 在 Windows 7 上存在同样的问题,包 WeightedCluster 的依赖项 r-traminer。最终使用install.packages 在 R 中安装。

标签: r anaconda readline ncurses conda


【解决方案1】:

虽然我开始时遇到了不同的问题,但最终的解决方案与我在其他地方发布的 How to install R-packages not in the conda repositories? 相同。为了完整起见,我在这里添加它。


最后,我通过关注 the approach recommended here 并将 anaconda 的 libreadline 符号链接到系统一解决了 rl_event_hook问题:

mv ~/anaconda3/lib/libreadline.s.6.2 ~/anaconda3/lib/libreadline.s.6.2.bak
ln -s /usr/lib/libreadline.so.6.3 ~/anaconda3/lib/libreadline.s.6.2

由于在 withing R 中使用 install.packages() 时无法加载共享对象,我仍然无法安装一些依赖重的 R 包。但是,更简单的包可以正常工作,我可以从 anacondas R 获得大部分依赖重的包-存储库。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-20
    • 2018-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-27
    相关资源
    最近更新 更多