问题
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:
** 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’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?
回答1:
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.
来源:https://stackoverflow.com/questions/53238157/why-installed-igraph-package-in-r-is-showing-error-upon-loading