Unable to load R package gsl: libgsl.so.25: cannot open shared object file: No such file or directory - r

My R version is 4.1.2. It seems that I successfully install gsl package, but when I run library(gsl), I get following error:
Error: package or namespace load failed for ‘energy’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/public/home/username/localR/lib64/R/library/gsl/libs/gsl.so':
libgsl.so.25: cannot open shared object file: No such file or directory
Only this package has the error above. Meanwhile, when I try to use the packages related to it(e.x. energy), R will occur the same error. However, other packages are not affected.
Thanks.

Related

Issue with the installation of terra package in R

I am using RRstudio 4.2.1 and I am trying to install the terra package.
Unfortunately, I get following error that I don't understand
Error: package or namespace load failed for ‘terra’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object 'my_path_here/R/x86_64-pc-linux-gnu-library/4.2/terra/libs/terra.so':
libproj.so.25: cannot open shared object file: No such file or directory
I haven't came across this error again, so I would like some help!
P.S when I am trying installing it from the terminal, I get the following in the middle of installation :./proj_conf_test: error while loading shared libraries: libproj.so.25: cannot open shared object file: No such file or directory
Thanks!

Unable to attach igraph or highcharter in Rstudio (libglpk.so.40: cannot open shared object file: No such file or directory)

I have a binder set up that makes use of highcharter. The package is installed, the system can find it and it is up to date. But when trying to attach it with library I get this:
> library(highcharter)
Error: package or namespace load failed for ‘highcharter’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/srv/rlibs/igraph/libs/igraph.so':
libglpk.so.40: cannot open shared object file: No such file or directory
I noted the mention of igraph, so I tried attaching that, but get the same error:
> library(igraph)
Error: package or namespace load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/srv/rlibs/igraph/libs/igraph.so':
libglpk.so.40: cannot open shared object file: No such file or directory
I've tried installing the latest dev version from github. The result of this was an error:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/tmp/RtmpK0dUBK/Rinst15a72b8aab6/00LOCK-igraph/00new/igraph/libs/igraph.so':
libopenblas.so.0: cannot open shared object file: No such file or directory
Error: loading failed
The binder system info is:
> Sys.info()
sysname
"Linux"
release
"5.4.129+"
version
"#1 SMP Wed Aug 18 19:58:18 PDT 2021"
nodename
"jupyter-nhsbsa-2ddata-2dana-2dffee-2dand-2dcoding-2d5y1715cc"
machine
"x86_64"
After several hours of Googling I've reached the limit of what I can do to troubleshoot this, any help appreciated!
Resolved by adding libglpk-dev to the apt.txt file. It is strange tho, as this did not used to be needed and it worked.

Error loading R package - libicui18n.so.68: cannot open shared object file

Until yesterday, I could run library(car) just fine. But after running yay -Syyu and upgrading as many packages as I can, this no longer works.
> library(car)
Loading required package: carData
Error: package or namespace load failed for ‘car’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/my-name/R/x86_64-pc-linux-gnu-library/4.0/stringi/libs/stringi.so':
libicui18n.so.68: cannot open shared object file: No such file or directory
I am running this on Arch Linux.
We can install the 'stringi' package
install.packages('stringi')

Loading R package without root permission: libproj.so.0: cannot open shared object file

I'm working in a SLURM server without root permission and I'm trying to load some R packages ('sp') to perform some analysis.
However, when I load the package I obtain the following error:
Loading required package: sp
Error: package or namespace load failed for ‘sp’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/tools/R/R-3.6.1/lib64/R/library/sp/libs/sp.so':
libproj.so.0: cannot open shared object file: No such file or directory
I checked where libproj.so.0 is located and I got these results:
/usr/lib64/libproj.so.0
/usr/lib64/libproj.so.0.7.0
My guess, by checking on similar problems on stackoverflow, is that I should create a symbolic link between /usr/lib64/libproj.so.0 and /usr/local/lib. However, I do not have root permission to do it successfully.
Any suggestion on how to solve the problem?

Why does installed "igraph" package return "libicui18n.so.58: cannot open shared object file"after loading?

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?
The library igraph requires 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.

Resources