我正在尝试安装 CRAN 群体遗传学包 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 上工作
我在 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
不会导致任何错误。
我在共享计算机上工作时遇到了与“stars”包相同的问题。我可以安装其他软件包,但不能安装这个。 通过以 sudo 身份运行 R 解决了该问题。 从航站楼出发:
sudo R # start R session as sudo
install.packages("<package_name>") # install your package
q() # quit R session