r - Jupyter 笔记本 : error installing R packages

标签 r ubuntu installation jupyter-notebook libstdc++

我正在使用 Ubuntu 16.04。

我在我的 Jupyter 笔记本上运行了 R,所有的包都带有“R essentials”,工作正常。

但是,当我尝试安装额外的软件包,如“mice”或“bigmemory”时,安装总是失败。当它试图做的时候

** testing if installed package can be loaded

这是出现的错误信息:

Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/usr/anaconda3/lib/R/library/bigmemory/libs/bigmemory.so': /home/usr/anaconda3/lib/R/library/Rcpp/libs/../../../../libstdc++.so.6: version 'GLIBCXX_3.4.20' not found (required by /home/usr/anaconda3/lib/R/library/bigmemory/libs/bigmemory.so)

我试过 sudo apt-get install libstdc++6 它说我的 libstdc++6 已安装并且已经是最新版本。我不知道为什么 R 安装程序找不到它..

最佳答案

我想通了!

我很沮丧,完全卸载了 anaconda3 rm -rf ~\anaconda3。重新安装后,我查看了 installing IRkernel 的说明.我看到了这个:

If this fails, search the output for something like:

** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Users/[you]/anaconda/lib/R/library/rzmq/libs/rzmq.so': dlopen(/Users/[you]/anaconda/lib/R/library/rzmq/libs/rzmq.so, 6): Library not loaded: libzmq.5.dylib Referenced from: /Users/[you]/anaconda/lib/R/library/rzmq/libs/rzmq.so Reason: image not found

This would mean that the R binary package of rzmq was compiled against a different version of libzmq from the one on your system. It can be fixed by installing from source

所以我按照说明做了 install.packages('mice','/home/[usr]/anaconda3/lib/R/library/',type = 'source')

成功了!我为“bigmemory”做了同样的事情。没有错误消息,我现在可以在 Jupyter notebook 上同时使用它们。

关于r - Jupyter 笔记本 : error installing R packages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38001827/

相关文章:

list - 将Data.frames列表组合成一个数据框

r - xts::apply 错误: "Error in coredata.xts(x) : currently unsupported data type"

ubuntu - 为什么 Go sha256 给出的结果与 Ubuntu 命令 sha256sum 不同?

git - 使用 Ubuntu Git 和 msysgit 直接处理相同的文件

java - 如何以简约的方式处理 "Calling home"?

r - 根据其他列中至少一个变量的出现按组创建新列

ubuntu - 在 ubuntu 上出现错误 : Command 'sudo' is available in '/usr/bin/sudo'

android - ionic 平台添加 android 命令失败,退出代码为 ENOENT

macos - 在 OSX 10.9.1 上安装 Google Cloud SDK 时遇到问题

R - 创建具有多列和多行的交叉表