0

Editor's note: The conclusion of the questioner in the title above is clearly not correct. There was a package available at the repository, but it wasn't getting installed correctly. (the reason was specified in an error message that wasn't included in the original question.) #-------------------------

I am just trying to work on R using shiny, but get this error when I try running the app and have tried install.packages("bslib") but doesn't help

Session Info: R version 4.0.5 (2021-03-31) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 10 x64 (build 19042)

attached base packages: 
[1] stats graphics grDevices utils datasets methods base 

other attached packages:
[1] shiny_1.6.0 

loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 crayon_1.4.1 withr_2.4.2 digest_0.6.27 later_1.2.0
[6] mime_0.10 R6_2.5.0 lifecycle_1.0.0 xtable_1.8-4 magrittr_2.0.1 
[11] rlang_0.4.10 cachem_1.0.4 promises_1.2.0.1 ellipsis_0.3.2 tools_4.0.5 
[16] httpuv_1.6.0 fastmap_1.1.0 compiler_4.0.5 htmltools_0.5.1.1

Did bslib install correctly? Any errors or messages?

The error I get when doing install.packages("bslib") is

Warning in install.packages : installation of package ‘bslib’ had non-zero exit status


OP: That's the same error I get and am not sure how to go about it!

Edit note: This was an attempted edit to my answer which was rejected by Community, but since it confirmed my suspicion that Rtools might be needed, I'm attaching it to the question body to clarify where the process stands at the moment:

* installing *source* package 'bslib' ...
** package 'bslib' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace 'sass' 0.3.1 is being loaded, but >= 0.4.0 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'bslib'
* removing 'C:/Users/loras/OneDrive/Documents/R/win-library/4.0/bslib'
Warning in install.packages :
  installation of package ‘bslib’ had non-zero exit status
This is what I get. I'll look into installing Rtools if you deem that necessary!
IRTFM
  • 258,963
  • 21
  • 364
  • 487
Ser Loras
  • 41
  • 1
  • 6
  • Did `bslib` install correctly? Any errors or messages? What are your versions -- can you edit your question with the results of `sessionInfo()` please . Also can you create a minimal example that reproduces your problem. perhaps using an example from https://rstudio.github.io/bslib/ – user20650 May 13 '21 at 19:23
  • 1
    what does your `getOption("repos")` say? – Vasily A May 13 '21 at 19:28
  • Also `.libPaths()` would be nice to see – Gregor Thomas May 13 '21 at 19:30
  • Session Info: R version 4.0.5 (2021-03-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042) attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] shiny_1.6.0 – Ser Loras May 13 '21 at 19:47
  • loaded via a namespace (and not attached): [1] Rcpp_1.0.6 crayon_1.4.1 withr_2.4.2 digest_0.6.27 later_1.2.0 [6] mime_0.10 R6_2.5.0 lifecycle_1.0.0 xtable_1.8-4 magrittr_2.0.1 [11] rlang_0.4.10 cachem_1.0.4 promises_1.2.0.1 ellipsis_0.3.2 tools_4.0.5 [16] httpuv_1.6.0 fastmap_1.1.0 compiler_4.0.5 htmltools_0.5.1.1 – Ser Loras May 13 '21 at 19:47
  • getOption("repos") gives: CRAN "https://cran.rstudio.com/" attr(,"RStudio") [1] TRUE – Ser Loras May 13 '21 at 19:47
  • .libPaths() gives: [1] "C:/Users/loras/OneDrive/Documents/R/win-library/4.0" [2] "C:/Program Files/R/R-4.0.5/library" – Ser Loras May 13 '21 at 19:48
  • The error I get when doing install.packages("bslib") is Warning in install.packages : installation of package ‘bslib’ had non-zero exit status – Ser Loras May 13 '21 at 19:50
  • @SerLoras' okay, thanks. So the package has not been installed hence you cannot use it. Do you get any other messages / errors? Perhaps some dependency doesn't install? – user20650 May 13 '21 at 20:02
  • Just that the package had non-zero exit status so yeah I am not sure how to properly install it – Ser Loras May 13 '21 at 20:10
  • Are you definitely installing the binary and not the source (sometimes you can be prompted to install a later source version) – user20650 May 13 '21 at 20:14
  • How do I know which is which? I literally just did the install.packages() command. That's it lol – Ser Loras May 13 '21 at 20:19
  • I have been having some trouble using cran.rstudio.com and also cloud.r-project.org ....I even have the mirror list (https://cran.r-project.org/mirrors.html) pulled up right now! I have just switched repos when it was acting like that, and it worked out. `install.packages("bslib", repos="https://mirror.las.iastate.edu/CRAN/")` for example. – Matt Watkins May 13 '21 at 20:57

1 Answers1

1

On my machine (not a Windows box) I needed to install (via compilation) the "sass" package before bslib could be installed. In fact several other packages, some of them not present on typical user setups, are required. From the packages DESCRIPTION file, these are all Suggested:, i.e required (not to mention the multiple "suggested" packages):

 grDevices, htmltools (>= 0.5.1), jsonlite, sass (>= 0.4.0), digest (>= 0.6.25), 
       jquerylib (>= 0.1.3), rlang, magrittr 

It's possible that you might succeed by trying this:

 install.packages("bslib", dependencies=TRUE)

Note the requirement of a specific version of "sass". When I go to the package page it appears that you might only be getting the r-release binary version: sass_0.3.1.zip, so it's further possible that you might need to compile version 0.4.0 from source. That's a process that requires Rtools on your computer. You can find many questions on SO and via web searches that will show how to install Rtools, if that is needed.

Once you have Rtools installed first, try this:

install.packages("sass", type="source")

Then repeat the installation of "bslib". (And don't forget to then load bslib-package if the installation is successful.)

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • I still get the same Warning in install.packages : installation of package ‘bslib’ had non-zero exit status message – Ser Loras May 13 '21 at 20:49
  • Read the rest of my answer (which I was composing as you were typing your comment.) Also you almost surely got more information than just that warning message. Please refresh this page to see the edits and include _everything_ that the R console told you. – IRTFM May 13 '21 at 20:50