为什么要安装"igraph"R中的软件包在加载时显示错误?

问题描述:

我试图使用命令install.packages("igraph")在R中安装igraph软件包.安装后,在测试阶段它显示以下错误:

I was trying to install the package igraph in R using the command install.packages("igraph"). After the installation, during testing phase it showed the following error:

**测试是否可以加载已安装的软件包错误:dyn.load中"igraph"的程序包或名称空间加载失败(文件,DLLpath = DLLpath,...):
无法加载共享对象'/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph/libs/igraph.so':
libicui18n.so.58:无法打开共享库文件:没有这样的文件或目录
错误:加载失败
执行停止
错误:加载失败
*删除"/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph"

** testing if installed package can be loaded Error: package or namespace load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph/libs/igraph.so':
libicui18n.so.58: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph’

已下载的源包位于
‘/tmp/RtmpLVDism/downloaded_pa​​ckages’
警告信息:
在install.packages("igraph")中:
软件包"igraph"的安装退出状态为非零

The downloaded source packages are in
‘/tmp/RtmpLVDism/downloaded_packages’
Warning message:
In install.packages("igraph") :
installation of package ‘igraph’ had non-zero exit status

为什么会这样?有什么解决办法?

Why this is happening? What could be a solution?

igraph需要库文件,例如libicui18n.so.58,libicuuc.so.58,libgfortran等.这些文件未安装在正确的库文件夹中,或者作为以前的版本存在.例如,以我为例,需要在"usr/lib64"中安装libicuuc.so.58.确保正确安装了依赖项才能解决此类问题.

igraph require library files such as libicui18n.so.58, libicuuc.so.58, libgfortran etc. These were either not installed in the proper library folder or were existing as previous versions. For example, in my case, libicuuc.so.58 was required to be installed in 'usr/lib64'. Make sure that dependencies are installed correctly to solve such problems.