Search code examples
rjupyter-notebookcranhmiscwatson-studio

Can not install the CRAN packages "viridis", "Hmisc" on IBM Watson Studio R Environment Notebooks


I am trying to install the CRAN Hmisc package in an R Environment Notebook on IBM Watson Studio. But it repeatedly fails with the following Error:

install.packages('Hmisc')

also installing the dependencies ‘checkmate’, ‘rstudioapi’, ‘Formula’, ‘latticeExtra’, ‘acepack’, ‘gridExtra’, ‘htmlTable’, ‘viridis’

Warning message in install.packages("Hmisc"):
“installation of package ‘viridis’ had non-zero exit status”Warning message in install.packages("Hmisc"):
“installation of package ‘Hmisc’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I tried to separately install the viridis package and that also fails with the same error:

install.packages('viridis')

Warning message in install.packages("viridis"):
“installation of package ‘viridis’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

Solution

  • In turns out to be an incorrect dependency management on viridis. It has a dependency over viridisLite >= 0.2.0. Latest viridis is expecting an object called cividis which was only added on the latest version of viridisLite > 0.2.0. DSX has viridisLite==0.2.0 already installed. Hence, the install of viridis fails. So basically, explicitly installing a newer version of viridisLite solves the issue.

    install.packages(c('viridisLite', 'Hmisc'))
    

    TL;DR - Install latest viridisLite and then install Hmisc