【发布时间】:2016-08-07 17:08:04
【问题描述】:
我正在使用 Anaconda 来管理我的 R 安装。它适用于 Anaconda 提供的 R 通道中可用的软件包,但我在安装 Anaconda 存储库中不包含的软件包时遇到了麻烦。
我尝试了几种不同的方法,下面列出了所有方法及其错误输出。
1。 install.packages('rafalib')
建议在这里工作conda - How to install R packages that are not available in "R-essentials"?。我的.libPaths() 指向'/home/user/anaconda2/lib/R/library'。
输出:
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
unsupported URL scheme
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/opt/anaconda1anaconda2anaconda3/lib/tcl8.5 ./lib/tcl8.5 ./lib/tcl8.5 ./library ./library ./tcl8.5.18/library ./tcl8.5.18/library
This probably means that Tcl wasn't installed properly.
我从 conda 频道 r-old 安装了 tcl,但 install.packages() 仍然抛出相同的错误消息。
2。 options(menu.graphics=FALSE) 然后install.packages('rafalib')
我得到了一个镜像列表并选择了一个。
输出:
Selection: 15
trying URL 'http://cran.utstat.utoronto.ca/src/contrib/rafalib_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11798 bytes (11 KB)
==================================================
downloaded 11 KB
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
The downloaded source packages are in
‘/tmp/Rtmphwpta0/downloaded_packages’
Warning message:
In install.packages("rafalib") :
installation of package ‘rafalib’ had non-zero exit status
2和3都来自Disable/suppress tcltk popup for CRAN mirror selection in R
3。在~/.Rprofile中设置镜像
在尝试install.packages() 之前,我将以下内容添加到我的~/.Rprofile。
## Default repo
local({r <- getOption("repos");
r["CRAN"] <- "http://cran.us.r-project.org";
options(repos=r)})
输出:
trying URL 'http://cran.us.r-project.org/src/contrib/rafalib_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11798 bytes (11 KB)
==================================================
downloaded 11 KB
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
The downloaded source packages are in
‘/tmp/RtmppIz9rT/downloaded_packages’
Warning message:
In install.packages("rafalib") :
installation of package ‘rafalib’ had non-zero exit status
4。将下载方法设置为“curl”或“wget”。
同时保留新的~/.Rprofile configuration。我想这不是必需的,因为该软件包现在似乎可以正常下载,但我测试了它以防万一。
输出:
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘rafalib’ failed
Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
download had nonzero exit status
5。手动download of rafalib
install.packages('../Downloads/rafalib_1.0.0.tar.gz', repos=NULL, type='source')
输出:
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Warning message:
In install.packages("../Downloads/rafalib_1.0.0.tar.gz", repos = NULL, :
installation of package ‘../Downloads/rafalib_1.0.0.tar.gz’ had non-zero exit status
6。从rafalib 构建一个 conda 包
我为此Errors building R-packages for conda 开了一个单独的问题。简而言之,它抱怨缺少我已经安装的依赖项。 更新我解决了依赖问题,现在我遇到了与其他方法相同的rl_signal_event_hook-error。
7。 sudo ln /usr/lib/libncursesw.so.6 /usr/lib/libncursesw.so.5
根据https://github.com/conda/conda/issues/1679,但它并没有为我解决问题。
看来我现在可以正常下载软件包,但安装失败。我之前在Jupyter Notebook 中使用带有irkernel 的R 时看到了错误消息sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook,但它从未妨碍我的工作。通过 anaconda 运行 python 时,我从未见过与该错误消息相关的任何内容。
我没有想法。有谁知道我如何安装不是由 anaconda 提供的 R 包,例如 rafalib 或 swirl?
我正在使用内核 4.4.5-1-ARCH 的 Linux(Antergos,Arch 衍生产品)。
2016 年 4 月 15 日更新
有一些related discussion in this thread。我试图通过安装不同版本的 ncurses 来解决这个错误,包括this patched version,并且我试图链接 readline 库,as suggested here,但我一直遇到同样的错误。在这一点上我很迷茫,如果能提供任何帮助来解决这个问题,我将不胜感激。
【问题讨论】:
-
你试过
install.packages("rafalib", repos = ""http://cran.us.r-project.org")吗? -
自安装依赖项以来您已经 ldconfig(ed) 了吗?
-
@Swarch 给出相同的
rl_signal_event_hook错误。 -
@Chris 我不熟悉
ldconfig。我在链接和安装依赖项之间重新启动,之后遇到同样的错误。我应该如何在这里使用ldconfig? -
当 R 尝试进行系统调用时,它看起来像是一个错误,因此与操作系统相关。如果你在命令行的 R 实例中做同样的事情,你会得到同样的错误吗?
标签: r anaconda readline ncurses conda