Error when loading r-sf and other spatial packages (gdal related)

  • Open
  • quality assurance status badge
One participant
  • Javier Vaquero Martínez
Submitted by
Javier Vaquero Martínez
Javier Vaquero Martínez wrote on 28 Mar 18:02 +0100
(address .
Dear guix community,

I am quite new to Guix so I apologize if I am doing something wrong.

I added channel guix-cran to get R packages. I installed r-sf r-terra,
and other packages. However, I cannot load them in R.

Here, at the end of the message I show and example with r-rgdal but same
thing happens with r-sf or r-terra.

Am I doing something wrong? Can you reproduce the bug?



|$ guix shell r r-rgdal -- R -e "library(rgdal)" R version 4.3.3
(2024-02-29) -- "Angel Food Cake" Copyright (C) 2024 The R Foundation
for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R
es un software libre y viene sin GARANTIA ALGUNA. Usted puede
redistribuirlo bajo ciertas circunstancias. Escriba 'license()' o
'licence()' para detalles de distribucion. R es un proyecto colaborativo
con muchos contribuyentes. Escriba 'contributors()' para obtener más
información y 'citation()' para saber cómo citar R o paquetes de R en
publicaciones. Escriba 'demo()' para demostraciones, 'help()' para el
sistema on-line de ayuda, o 'help.start()' para abrir el sistema de
ayuda HTML con su navegador. Escriba 'q()' para salir de R. >
library(rgdal) Loading required package: sp Error: package or namespace
load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
undefined symbol: GEOSConcaveHull_r |

Attachment: file
Javier Vaquero Martínez wrote on 4 Apr 18:04 +0200
(address .
So I managed to solve this. It turns out that some environment variables
where making this error to happen. Running in an isolated environment
with `guix shell -C r r-sf -- r` solves the problem.