简体   繁体   English

无法安装ggp​​lot2:“ library.dynam(lib,package,package.lib)中的错误:找不到共享对象'stringi.so'”

[英]Cannot install ggplot2: “Error in library.dynam(lib, package, package.lib) : shared object ‘stringi.so’ not found”

Last week I upgraded from Ubuntu 14.04 to 14.10. 上周,我从Ubuntu 14.04升级到14.10。 The first time I've tried to use ggplot in RStudio since the update, I'm getting dependancy errors with my ggplot package and its no longer registered as installed (was working fine before). 自更新以来,我第一次尝试在RStudio中使用ggplot,但我的ggplot程序包出现依赖错误,并且不再注册为已安装(之前工作正常)。 When I try to reinstal ggplot2: 当我尝试重新安装ggp​​lot2时:

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

The installation fails while trying to install the dependencies. 尝试安装依赖项时安装失败。 Here's what the tail of the output looks like: 这是输出尾部的样子:

* 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’

I have a feeling this is the line (below) I should be looking at, but I'm not sure how to interprete this error, anyone have any suggestions for me? 我感觉这是我应该看的一行(下面),但是我不确定如何解释此错误,有人对我有什么建议吗? I really have no idea where to go from here, as I couldent find any other people experiencing the same error as me. 我真的不知道该从哪里去,因为我可以找到其他遇到与我相同的错误的人。

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

Not sure if the Ubuntu upgrade I did relates to this... but I thought'd I'd mention it just in case. 不知道我所做的Ubuntu升级是否与此有关...但是我想我会提到它以防万一。

Following @Nick Kennedey's comment, I tried installing stringi like this: 在@Nick Kennedey的评论之后,我尝试安装像这样的stringi

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

Which resulted in this error I hadn't seen before: 这导致了我之前从未见过的错误:

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)

So the I followed the suggestion in the error an removed the LOCK folder. 因此,我按照错误中的建议删除了LOCK文件夹。

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

Then tried installing the stringi package again, and it worked! 然后尝试再次安装stringi软件包,它成功了! This was the issue... now I've just finished installing with no issues. 这就是问题所在...现在,我刚刚完成安装,没有任何问题。

I am still a little bit confused though... as to how this error can come about. 不过,我还是有点困惑...关于如何发生此错误。 Any ideas on what causes this so I can avoid it in the future? 关于什么原因的任何想法,以便我将来可以避免? Is it possible it was a symptom of my recent upgrade to 14.10? 这是否可能是我最近升级到14.10的症状?

Got the same error while installing install.packages("knitr") 安装install.packages("knitr")相同的错误

Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/usr/local/lib/R/site-library/stringi/libs/stringi.so' dyn.load中的错误(文件,DLLpath = DLLpath,...):无法加载共享对象'/usr/local/lib/R/site-library/stringi/libs/stringi.so'

I solved it by doing the below: 我通过执行以下操作解决了该问题:

In Ubuntu 16.04 and above 在Ubuntu 16.04及更高版本中

sudo apt install r-cran-stringi

In earlier versions (which had apt-get) 在早期版本中(具有apt-get)

sudo apt-get install r-cran-stringi

In my case I solved the problem through installing stringi and ggplot2 from the terminal of linux. 就我而言,我通过从linux终端安装stringi和ggplot2解决了该问题。 The problem has some relation with RStudio. 该问题与RStudio有关。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 library.dynam 中的错误(lib,package,package.lib)共享对象<library_name> .所以没找到</library_name> - error in library.dynam(lib, package, package.lib) shared ovject <library_name>.so not found 错误:library.dynam(lib, package, package.lib) 中“data.table”的包或命名空间加载失败:找不到共享对象“datatable.so” - Error: package or namespace load failed for ‘data.table’ in library.dynam(lib, package, package.lib): shared object ‘datatable.so’ not found 使用dyn.load或library.dynam来调用R包中的C ++函数 - use dyn.load or library.dynam to call a C++ function in an R package R 3.4.2 库中的错误(ggplot2):没有名为“ggplot2”的包 - R 3.4.2 Error in library(ggplot2) : There is no package called 'ggplot2' 库中的错误(ggplot2):没有名为“ggplot2”的包执行停止 - Error in library(ggplot2) : there is no package called ‘ggplot2’ Execution halted 安装 stringr、stringi “Error: package or namespace load failed for 'stringi' in dyn.load(file, DLLpath = DLLpath, ...)”和共享 object 问题 - installing stringr, stringi “Error: package or namespace load failed for ‘stringi’ in dyn.load(file, DLLpath = DLLpath, …)” and shared object issue 错误:加载插入符号包时找不到包“ggplot2” - Error: Package “ggplot2” could not be found, when loading the caret package 安装自定义程序包时,“lib.loc”中找不到库树 - No library trees found in 'lib.loc' when installing custom package R 在 renv 中安装 package stringi - R install package stringi in renv 使用自定义lib的package.install无法加载包 - package.install with custom lib cannot load packages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM