rgdal安装在Ubuntu 18.04 LTS中,但R 3.5无法识别它。

问题描述 投票:0回答:1

我试图在R 3.5(Ubuntu 18.04)中安装 "rdgal "包,但是,R显示了这个错误。

configure: R_HOME: /opt/R/3.5.3/lib/R
configure: CC: gcc
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... yes
configure: svn revision: 845
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/sergiob/R/x86_64-pc-linux-gnu-library/3.5/rgdal’

The downloaded source packages are in
        ‘/tmp/Rtmp0rrlnK/downloaded_packages’
Warning message:
In install.packages("rgdal") :
  installation of package ‘rgdal’ had non-zero exit status

然而,GDAL似乎被安装在系统中,使用了 gdalinfo --version

GDAL 2.2.3, released 2017/11/20

并使用 dpkg -l | grep gdal | cut -c-72 (似乎Ubuntu有两个版本:2.2和2.4)

ii  gdal-bin                                        2.2.3+dfsg-2        
ii  gdal-data                                       2.4.2+dfsg-1~bionic0
ii  libgdal20                                       2.2.3+dfsg-2        
ii  python-gdal                                     2.2.3+dfsg-2        
ii  python3-gdal                                    2.2.3+dfsg-2

此外,我还安装了QGIS 3.13(带有GDALORG 2.2.3),但我无法确定这是否是真正的问题。

我试着重新安装了所有的依赖项和软件包,包括 sudo apt-get install libgdal-dev libproj-dev但不解决任何问题。

我试着看了所有关于这个问题的帖子,但是,我还不能解决这个问题。

有什么方法可以让R识别安装在Ubuntu 18.04中的GDAL?

r linux dependencies ubuntu-18.04 rgdal
1个回答
0
投票

解决方法是卸载QGIS,先安装GDAL,之后再重新安装QGIS。

最后,在R中安装rGDAL是可以的。

© www.soinside.com 2019 - 2024. All rights reserved.