cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Unable to install sf and rgeos R packages on the cluster

User16753724663
Valued Contributor

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;

1 REPLY 1

User16753724663
Valued Contributor

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)

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.