简体   繁体   中英

R load error - libproj.so.13: cannot open shared object file: No such file or directory

I am trying to install CRANs population genetics packagehierfstat ; however the following error with libproj.so.13 is printed:

> install.packages("hierfstat")
Installing package into ‘/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/hierfstat_0.04-22.tar.gz'
Content type 'application/x-gzip' length 460778 bytes (449 KB)
==================================================
downloaded 449 KB

* installing *source* package ‘hierfstat’ ...
** package ‘hierfstat’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6/sf/libs/sf.so':
  libproj.so.13: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘hierfstat’
* removing ‘/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6/hierfstat’
* restoring previous ‘/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6/hierfstat’
Warning in install.packages :
  installation of package ‘hierfstat’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpXDoNEK/downloaded_packages’

Any suggestions on how to fix this error? I am working on Ubuntu-20.04

I was also facing same issue with ubuntu 20.04. In my case, I had extend my LD library path. In bash

export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib

In tcsh

setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:/lib
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:/usr/lib
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:/usr/local/lib

Afterwards, you could already see that shared libraries can now be found if

/usr/local/bin/proj

does not result in any error.

I had the same issue with package "stars" while working on a shared computer. Other packages I was able to install, but not this one. The issue was solved by running R as sudo . From Terminal:

sudo R                                # start R session as sudo
install.packages("<package_name>")    # install your package
q()                                   # quit R session 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM