gpt4 book ai didi

r - Jupyter 笔记本 : error installing R packages

转载 作者:太空宇宙 更新时间:2023-11-03 16:52:25 28 4
gpt4 key购买 nike

我正在使用 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com