加载 rgdal 时出错 [英] Error loading rgdal
问题描述
我已经成功安装了 rgdal
包以及依赖项 GDAL 和 Proj4.安装后,我使用 library
函数成功地将包加载到 R 中.但是,在我最近一次登录后,当我输入命令 library(rgdal)
时,我收到一条错误消息:
I have successfully installed the rgdal
package along with the dependencies GDAL and Proj4. After installation I succesfully loaded the package in R with the library
function. However after my most recent login when i type in the command library(rgdal)
I get an error message:
Error: package or namespace load failed for 'rgdal' in dyn.load(file,
DLLpath = DLLpath, ...):
unable to load shared object '/home/nikhail1/R/x86_64-pc-linux-gnu-
library/3.4/rgdal/libs/rgdal.so':
libgdal.so.20: cannot open shared object file: No such file or directory
我理解这意味着没有指向 libgdal 文件的链接,但我不确定如何修复它.libgdal.so.20 在/home/nikhail1/bin/gdal/lib/下的系统中.rgdal.so 文件位于我的/home/nikhail1/系统中的 R 库中的 rgdal 文件夹下.我无权在共享库上执行 ldconfig
功能(我是新手).有没有人有一个功能可以帮助我让系统识别到 libgdal.so.20 的路径.我正在使用 Linux CentOs 6.9 系统.我无法执行任何 sudo apt-get
、yum
或 brew
功能.
I understand this means there is no link to the libgdal file but I am not sure how to fix it. libgdal.so.20 is in the system under /home/nikhail1/bin/gdal/lib/. The rgdal.so file is under the rgdal folder in the R library in my /home/nikhail1/ system. I do not have the authority to perform an ldconfig
function on shared libraries (I am a novice). Does anyone have a function that could help me make the system recognize the pathway to libgdal.so.20. I am working on a Linux CentOs 6.9 system. I cannot perform any sudo apt-get
, yum
or brew
functions.
非常感谢,尼哈伊尔
推荐答案
可以设置LD_LIBRARY_PATH
包含/home/nikhail1/bin/gdal/lib
,即在重击
You can set LD_LIBRARY_PATH
to include /home/nikhail1/bin/gdal/lib
, i.e. in bash
export LD_LIBRARY_PATH="/home/nikhail1/bin/gdal/lib:$LD_LIBRARY_PATH"
ldd /home/nikhail1/R/x86_64-pc-linux-gnu-library/3.4/rgdal/libs/rgdal.so
应该报告 libgdal.so.20
被发现.如何使其持久化取决于您的桌面环境.
should report libgdal.so.20
as been found. How to make this persistent depends on your desktop environment.
这篇关于加载 rgdal 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!