Conf failed because libudunits2.so was not found

I’m seeing a failure that I think has to do with the OS. But, I’m not a Jupyter user or a sys admin and am looking for some guidance…

I’m trying to launch an RStudio binder. I have created several other RStudio binders without problems, but this one is not working.

RStudio Binder launch-URL for github.com/libjohn/mapping-with-R

The RStudio IDE launches fine, but I cannot run the notebooks (e.g. 01_georeference.Rmd) due to the absence of “libudunits2.so” – I don’t think this is an R thing. Part of this error may be related to the fact that my .binder/install.R does identify mapview and sf R package libraries among others, but they are not actually installed in the RStudio binder. The other R package libraries do install.

I’ve tried manually installing either of the two packages (sf or mapview) and get similar errors. The error message, inside the RStudio console, for install.packages("sf") is…

configure: error: in `/tmp/Rtmpg4Y9d6/R.INSTALL3b6e072c15/units’:
configure: error:

Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, …)
* rpm: udunits2-devel (Fedora, EPEL, …)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
–configure-args=’–with-udunits2-lib=/usr/local/lib’
if the library was not found, and/or:
–configure-args=’–with-udunits2-include=/usr/include/udunits2’
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.

Try adding a file named apt.txt to the .binder directory inside your repo and have the content be the following:

libudunits2-dev
libgdal-dev
libgeos-dev
libproj-dev

Based on here and the use of an apt.txt configuration file.

1 Like

That worked. Thanks @fomightez

1 Like