4

我正在尝试安装 CRANs 人口遗传学包hierfstat;但是会打印 libproj.so.13 的以下错误:

> 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’

有关如何解决此错误的任何建议?我正在开发 Ubuntu-20.04

4

2 回答 2

2

我在 ubuntu 20.04 上也遇到了同样的问题。就我而言,我扩展了我的 LD 库路径。在 bash

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

在 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

之后,您已经可以看到现在可以找到共享库,如果

/usr/local/bin/proj

不会导致任何错误。

于 2020-10-21T13:57:36.100 回答
0

在共享计算机上工作时,我遇到了与包“stars”相同的问题。我能够安装的其他软件包,但不是这个。通过将 R 作为 sudo 运行解决了该问题。从终端:

sudo R                                # start R session as sudo
install.packages("<package_name>")    # install your package
q()                                   # quit R session 
于 2020-12-17T11:40:04.240 回答