centos tidyverse 报错 libicui18n.so.58 解决方法

报错信息

Error : /tmp/Rtmp7cfZnR/R.INSTALL291a47a178675/xml2/man/read_xml.Rd:47: 无法载入共享目标对象‘/opt/microsoft/ropen/3.5.3/lib64/R/library/xml2/libs/xml2.so’::
  libicui18n.so.58: 无法打开共享对象文件: 没有那个文件或目录
ERROR: installing Rd objects failed for package ‘xml2’
* removing ‘/opt/microsoft/ropen/3.5.3/lib64/R/library/xml2’
ERROR: dependency ‘xml2’ is not available for package ‘rvest’
* removing ‘/opt/microsoft/ropen/3.5.3/lib64/R/library/rvest’
ERROR: dependencies ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’
* removing ‘/opt/microsoft/ropen/3.5.3/lib64/R/library/tidyverse’

下载的程序包在
	‘/tmp/Rtmp0oAdDA/downloaded_packages’里
更新'.Library'里的HTML程序包列表
Making 'packages.html' ... 做完了。
Warning messages:
1: In install.packages("tidyverse") :
  安装程序包‘xml2’时退出狀態的值不是0
2: In install.packages("tidyverse") :
  安装程序包‘rvest’时退出狀態的值不是0
3: In install.packages("tidyverse") :
  安装程序包‘tidyverse’时退出狀態的值不是0

解决方法:

查看这个库在那里

locate libicui18n.so.58

我的结果:

/root/anaconda3/lib/libicui18n.so.58
/root/anaconda3/lib/libicui18n.so.58.2

那么我就设置/root/anaconda3/lib为库libicui18n.so.58, 设置方法如下:

[root@localhost ~]# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/anaconda3/lib
[root@localhost ~]# export LD_LIBRARY_PATH

设置完成之后, 进入R, 安装tidyverse

> install.packages("tidyverse")
还安装相依关系‘rvest’

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1592k  100 1592k    0     0   936k      0  0:00:01  0:00:01 --:--:--  936k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 61647  100 61647    0     0  54123      0  0:00:01  0:00:01 --:--:-- 54123
* installing *source* package ‘rvest’ ...
** 成功将‘rvest’程序包解包并MD5和检查
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (rvest)
* installing *source* package ‘tidyverse’ ...
** 成功将‘tidyverse’程序包解包并MD5和检查
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (tidyverse)

下载的程序包在
	‘/tmp/Rtmp9JY0Br/downloaded_packages’里
更新'.Library'里的HTML程序包列表
Making 'packages.html' ... 做完了。

永久设置方法

将下面代码, 追加到~/.bashrc文件中(前提是你的当前目录下有anaconda3, 如果没有的话, 就按照一个anaconda吧.)

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/anaconda3/lib
export LD_LIBRARY_PATH

执行命令:
source ~/.bashrc

关注我:育种数据分析之放飞自我

你可能感兴趣的:(R语言)