【问题标题】:sf R package "is not compatible with GDAL versions below 2.0.0" after installing gdal 2.3 from conda从 conda 安装 gdal 2.3 后,sf R 包“与 2.0.0 以下的 GDAL 版本不兼容”
【发布时间】:2018-12-24 07:41:57
【问题描述】:

在尝试安装sf R 包时,我收到了错误消息:

checking GDAL version >= 2.0.0... no
configure: error: sf is not compatible with GDAL versions below 2.0.0

然后我安装了gdal 2.3.1 from conda 并确认了版本:

gdalinfo --version

GDAL 2.3.1,于 2018 年 6 月 22 日发布

但我仍然收到相同的错误消息。

SF on R 3.5 can't find correct version of gdal 看起来很相似,但他们的解决方案涉及在 conda 之外安装。我在 Ubuntu 上。

如何让sf 识别我安装的gdal 的正确版本?

编辑:sessionInfo()R 显示:

R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1

从 conda 安装 R 时遇到另一个问题

编辑:通过conda install -c r r 从 conda 安装 R 时,我收到此错误:

-----Error: libudunits2.a not found-----
     If the udunits2 library is installed in a non-standard location,
     use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
     or --configure-args='--with-udunits2-include=/usr/include/udunits2'
     replacing paths with appropriate values for your installation.
     You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
     environment variables.
     If udunits2 is not installed, please install it.
     It is required for this package.

从 conda 安装 udunitsudunits2 后仍然如此:

conda install -c conda-forge udunits
conda install -c conda-forge udunits2

【问题讨论】:

  • 您也可以尝试从 conda 安装 R。
  • @Ista 我之前也这样做过,但出现了一些其他错误,所以选择了 CRAN,但我正在重试,并将通过更新进行编辑。
  • @ista 在从 conda 安装 R 时更新了单独的问题,涉及 udunits。

标签: r ubuntu conda gdal


【解决方案1】:

以下内容对我有用,尽管我在 Centos 6 而不是 Ubuntu 16.04 上运行它。

conda create -n rsf r-udunits2 geos gdal proj4
source activate rsf
R

.

install.packages("sf")
library("sf")

【讨论】:

  • 在没有goes 的情况下工作,谢谢!当我在我的默认环境中执行此操作时,我收到一条类似r-sig-geo.2731867.n2.nabble.com/… 的错误消息,因此我的GDAL 安装似乎已损坏。我会尝试卸载一些gdal相关的包。
  • 抱歉,go 是一个错字,我的意思是geos。我现在更正了。
【解决方案2】:

错误是由非 conda 包安装引起的。在干净的环境中,可以安装sfdirectly from conda

conda create -n rsf -c conda-forge r-sf
source activate rsf

或来自干净的环境:

conda install -c conda-forge r-sf

【讨论】:

    【解决方案3】:

    在使用 r-sf 和 r-gdal 在 OSX 上的 conda 中遇到类似的冲突问题后,我能够通过在启动新环境后立即安装它们来使用新环境安装它们

    conda install -c conda-forge r-essentials geos r-rgeos r-rgdal r-sf
    

    【讨论】:

      猜你喜欢
      • 2016-02-08
      • 2020-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-21
      • 1970-01-01
      • 1970-01-01
      • 2021-03-24
      相关资源
      最近更新 更多