gpt4 book ai didi

r - 无法安装 ggplot2 : "Error in library.dynam(lib, package, package.lib) : shared object ‘stringi.so’ not found"

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

上周我从 Ubuntu 14.04 升级到 14.10。自更新以来我第一次尝试在 RStudio 中使用 ggplot,我的 ggplot 包出现依赖性错误并且它不再注册为已安装(之前工作正常)。当我尝试重新安装 ggplot2 时:

install.packages("ggplot2",dep=TRUE)

尝试安装依赖项时安装失败。输出的尾部如下所示:

* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
ERROR: lazy loading failed for package ‘stringr’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/stringr’
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
ERROR: dependency ‘stringr’ is not available for package ‘reshape2’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependency ‘reshape2’ is not available for package ‘ggplot2’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpWNyAha/downloaded_packages’

我觉得这是我应该查看的行(下方),但我不确定如何解释此错误,有人对我有任何建议吗?我真的不知道从这里去哪里,因为我找不到任何其他人遇到与我相同的错误。

Error in library.dynam(lib, package, package.lib) : 
shared object ‘stringi.so’ not found

不确定我所做的 Ubuntu 升级是否与此有关......但我想我会提到它以防万一。

最佳答案

根据@Nick Kennedey 的评论,我尝试像这样安装 stringi:

> install.packages("stringi",dep=TRUE)

这导致了我以前从未见过的错误:

2015-08-07 10:26:35 (256 KB/s) - ‘/tmp/RtmpQI4Uau/downloaded_packages/stringi_0.5-5.tar.gz’ saved [3639183/3639183]

ERROR: failed to lock directory ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1’ for modifying
Try removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/00LOCK-stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpQI4Uau/downloaded_packages’
> install.packages("stringi",dep=TRUE)

所以我按照错误中的建议删除了 LOCK 文件夹。

在终端中:rm -r/home/james/R/x86_64-pc-linux-gnu-library/3.1/00LOCK-stringi’

然后再次尝试安装 stringi 包,成功了!这就是问题所在...现在我已经完成安装,没有任何问题。

虽然我仍然有点困惑...关于这个错误是如何产生的。关于导致这种情况的原因的任何想法,以便我将来可以避免它?这可能是我最近升级到 14.10 的症状吗?

关于r - 无法安装 ggplot2 : "Error in library.dynam(lib, package, package.lib) : shared object ‘stringi.so’ not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31866299/

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