sf R包“与2.0.0以下的GDAL版本不兼容".从conda安装gdal 2.3之后 [英] sf R package "is not compatible with GDAL versions below 2.0.0" after installing gdal 2.3 from conda
问题描述
在尝试安装 sf
R软件包时,出现错误消息:
In trying to install the sf
R package, I got the error message:
checking GDAL version >= 2.0.0... no
configure: error: sf is not compatible with GDAL versions below 2.0.0
然后我从conda安装了 gdal
2.3.1 ,并且确认版本:
I then installed gdal
2.3.1 from conda and confirmed the version:
gdalinfo --version
GDAL 2.3.1,发布于2018/06/22
GDAL 2.3.1, released 2018/06/22
但是我仍然收到相同的错误消息.
But I still get the same error message.
R 3.5上的SF无法找到正确的gdal版本看起来很相似,但是他们的解决方案涉及在conda之外安装.我在Ubuntu上.
SF on R 3.5 can't find correct version of gdal looks similar but their solution involved installing outside of conda. I'm on Ubuntu.
如何获取 sf
来识别已安装的 gdal
的正确版本?
How can I get sf
to recognize the correct version of gdal
I have installed?
R
中的 sessionInfo()
显示:
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时遇到另一个问题
I had another issue when installing R from conda
通过 conda install -c r r
从conda安装R时,出现此错误:
When installing R from conda via conda install -c r r
, I got this error:
-----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安装 udunits
和 udunits2
后,情况仍然如此:
This was still the case after installing udunits
and udunits2
from conda:
conda install -c conda-forge udunits
conda install -c conda-forge udunits2
推荐答案
错误是由非conda软件包安装引起的.可以在干净的环境中直接从 安装
: sf
软件包.> conda
Errors are caused by non-conda package installations. From a clean environment, the sf
package can be installed directly from conda
:
conda create -n rsf -c conda-forge r-sf
source activate rsf
或者在干净的环境中:
conda install -c conda-forge r-sf
这篇关于sf R包“与2.0.0以下的GDAL版本不兼容".从conda安装gdal 2.3之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!