Unable to install sf and rgeos R packages on the cluster
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 10:20 AM
Got following error
java.lang.RuntimeException: Installation failed with message:
Error installing R package: Could not install package with error: installation of package ‘rgdal’ had non-zero exit status
Full error log available at /databricks/driver/library-install-logs/r-package-installation-rgdal-2021-05-10T09:12:47Z-_1XBW4.log
Error installing R package: Could not install package with error: installation of package ‘rgdal’ had non-zero exit status
Full error log available at /databricks/driver/library-install-logs/r-package-installation-rgdal-2021-05-10T09:12:47Z-iT1LlL.log;
Labels:
- Labels:
-
Packages
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 10:21 AM
We can use the below init script to install the packages in the cluster:
%scala
dbutils.fs.put("dbfs:/databricks/init_scripts/rlib.sh", """
#!/bin/bash
sudo apt-get install -y libudunits2-dev
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev
sudo apt-get install -y libfontconfig1-dev
sudo apt-get install -y libcairo2-dev
sudo apt-get install -y libprotobuf-dev
sudo apt-get install -y protobuf-compiler
sudo add-apt-repository -y ppa:opencpu/jq
sudo apt-get install -y libjq-dev
sudo apt-get install -y libv8-dev
R -e 'install.packages(c("rgdal", "RJDBC", "sf", "rgeos"), dependencies = T, repos = "https://cran.r-project.org")'
""",true)