加载rgdal时出错 [英] Error loading rgdal

查看:77
本文介绍了加载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.

非常感谢Nikhail

Many thanks, Nikhail

推荐答案

您可以将 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆