繁体   English   中英

在Ubuntu 16.04上安装rgdal的更多麻烦

[英]More trouble Installing rgdal on ubuntu 16.04

已发布的其他类似问题未解决安装rgdal的问题。 我使用http://www.sarasafavi.com/installing-gdalogr-on-ubuntu.html上的建议安装了gdal,并且还描述了其他答案,例如在ubuntu 16.04上安装rgdal的麻烦,这意味着从ppa:ubuntugis。

然后,当我尝试安装rgdal时,出现以下错误

> install.packages("rgdal")
Installing package into ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... no
configure: svn revision: 766
checking for gdal-config... /home/leonardo/anaconda3/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.2
checking GDAL version >= 1.11.4... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
/usr/bin/x86_64-linux-gnu-ld: warning: libproj.so.12, needed by /home/leonardo/anaconda3/lib/libgdal.so, not found (try using -rpath or -rpath-link)
/usr/bin/x86_64-linux-gnu-ld: warning: libpoppler.so.71, needed by /home/leonardo/anaconda3/lib/libgdal.so, not found (try using -rpath or -rpath-link)
/usr/bin/x86_64-linux-gnu-ld: warning: libxerces-c-3.2.so, needed by /home/leonardo/anaconda3/lib/libgdal.so,

...

500 lines more

...

/home/leonardo/anaconda3/lib/libgeos_c.so: undefined reference to `geos::geom::PrecisionModel::PrecisionModel(double)'
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

我以前安装的python anaconda似乎有问题,我使用删除了anaconda python gdal软件包

conda remove gdal

但是问题仍然存在

解决此问题的唯一方法是按照https://conda.io/docs/user-guide/install/linux.html#uninstalling-anaconda-or-miniconda上的说明完全删除anaconda安装,并对ubuntu进行一些小的修改16.04,您必须打开终端并删除anaconda安装目录:

rm -rf ~/anaconda3

rm -rf ~/.condarc ~/.conda ~/.continuum

编辑~/.bashrc以从PATH环境变量中删除anaconda目录。

之后安装rgdal

install.packages("rgdal")

毫无问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM