Installing notebooked scoped survminer package from CRAN on Databricks Azure

Ross Hamilton 21 Reputation points
2022-07-15T11:38:20.763+00:00

I am currently using Databricks 10.4 LTS and an attempting to install the R package survminer which doesn't seem to be working.

https://CRAN.R-project.org/package=survminer

I am using the following code for repro:

install.packages("survminer", repos = "https://cran.microsoft.com/snapshot/2022-06-24/")  

I get the following output which says compilation terminated and it looks to me as if there is an issue installing the package jpeg. I have also tried separately installing jpeg but this comes up with the same error.

* installing *source* package ‘jpeg’ ...  
** package ‘jpeg’ successfully unpacked and MD5 sums checked  
** using staged installation  
** libs  
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-i2PIHO/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c read.c -o read.o  
In file included from read.c:1:  
rjcommon.h:11:10: fatal error: jpeglib.h: No such file or directory  
   11 | #include <jpeglib.h>  
      |          ^~~~~~~~~~~  
compilation terminated.  
make: *** [/usr/lib/R/etc/Makeconf:168: read.o] Error 1  
ERROR: compilation failed for package ‘jpeg’  
* removing ‘/local_disk0/.ephemeral_nfs/envs/rEnv-6d56942f-5b26-4324-a5a9-5b6efc753410/jpeg’  
ERROR: dependency ‘jpeg’ is not available for package ‘gridtext’  
* removing ‘/local_disk0/.ephemeral_nfs/envs/rEnv-6d56942f-5b26-4324-a5a9-5b6efc753410/gridtext’  
ERROR: dependency ‘gridtext’ is not available for package ‘ggtext’  
* removing ‘/local_disk0/.ephemeral_nfs/envs/rEnv-6d56942f-5b26-4324-a5a9-5b6efc753410/ggtext’  
ERROR: dependency ‘ggtext’ is not available for package ‘survminer’  
* removing ‘/local_disk0/.ephemeral_nfs/envs/rEnv-6d56942f-5b26-4324-a5a9-5b6efc753410/survminer’  
Installing package into ‘/local_disk0/.ephemeral_nfs/envs/rEnv-6d56942f-5b26-4324-a5a9-5b6efc753410’  
(as ‘lib’ is unspecified)  
also installing the dependencies ‘jpeg’, ‘gridtext’, ‘ggtext’  
  
trying URL 'https://cran.microsoft.com/snapshot/2022-06-24/src/contrib/jpeg_0.1-9.tar.gz'  
Content type 'application/octet-stream' length 18596 bytes (18 KB)  
==================================================  
downloaded 18 KB  
  
trying URL 'https://cran.microsoft.com/snapshot/2022-06-24/src/contrib/gridtext_0.1.4.tar.gz'  
Content type 'application/octet-stream' length 234461 bytes (228 KB)  
==================================================  
downloaded 228 KB  
  
trying URL 'https://cran.microsoft.com/snapshot/2022-06-24/src/contrib/ggtext_0.1.1.tar.gz'  
Content type 'application/octet-stream' length 1211846 bytes (1.2 MB)  
==================================================  
downloaded 1.2 MB  
  
trying URL 'https://cran.microsoft.com/snapshot/2022-06-24/src/contrib/survminer_0.4.9.tar.gz'  
Content type 'application/octet-stream' length 3599577 bytes (3.4 MB)  
==================================================  
downloaded 3.4 MB  
  
Warning in utils::install.packages(pkgs, ...) :  
  installation of package ‘jpeg’ had non-zero exit status  
Warning in utils::install.packages(pkgs, ...) :  
  installation of package ‘gridtext’ had non-zero exit status  
Warning in utils::install.packages(pkgs, ...) :  
  installation of package ‘ggtext’ had non-zero exit status  
Warning in utils::install.packages(pkgs, ...) :  
  installation of package ‘survminer’ had non-zero exit status  
  
The downloaded source packages are in  
 ‘/tmp/RtmpGTVXP1/downloaded_packages’  

Any help provided is greatly appreciated!

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,843 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 73,646 Reputation points Microsoft Employee
    2022-07-19T06:18:05.057+00:00

    Hello @Ross Hamilton ,

    Thanks for the question and using MS Q&A platform.

    You may try the below steps to successfully install the package without any issue.

    Tried on DBR: 10.4 LTS (includes Apache Spark 3.2.1, Scala 2.12)

    Step1: Make sure to install libjpeg-dev first using %sh apt-get -y install libjpeg-dev

    Step2: Install survminer package using install.packages("survminer", repos = "https://cran.microsoft.com/snapshot/2022-06-24/")

    Step3: Now you are able to load the package library(survminer)

    222151-image.png

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful