RStudio Cloud: Package installation issues

I was playing around with rstudio.cloud after @mara tweeted about it, but it seems I can't get very far due to multiple packages not installing properly.

The packages in question seem to be quantreg and rgl, which I don't use directly but are dependencies of packages I would like to use, namely tadaatoolbox and sjPlot.

The following error arises when I try to install tadaatoolbox:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/quantreg/libs/quantreg.so':
  libRlapack.so: cannot open shared object file: No such file or directory
ERROR: lazy loading failed for package ‘tadaatoolbox’
* removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/tadaatoolbox’

However, even after manually removing/reinstalling quantreg and verifying that the file in question does indeed exist:

> file.exists("/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.4/quantreg/libs/quantreg.so")
[1] TRUE

I still get the same error.
For sjPlot, there are more errors, apparently coming down to TMB not being able to install properly.
When I had similar issues with package installations on Ubuntu Xenial, I could fix them by installing the r-base-dev system package or similar means, which leads me to assume that the docker image I assume RStudio Cloud is powered by might lack certain packages, but that's just a wild guess on my part.

Furthermore, I would like to state that I am indeed aware RStudio Cloud is in Alpha and I can not expect anything to work perfectly just yet, I just wanted to play around with it and give feedback on possible issues.

I hope this is the right place for this topic, there aren't any other topics re rstudio.cloud around here so I hope I'm not stepping on anyone's toes.

2 Likes

I don' think you are alone, I've run into issues trying to install packages with devtools, so maybe the linux machine is missing packages needed to run properly?
I've run into some issues with trying to install packages via devtools:

> devtools::install_github("sailthru/tidyjson")
Downloading GitHub repo sailthru/tidyjson@master
from URL https://api.github.com/repos/sailthru/tidyjson/zipball/master
Installing tidyjson
Installation failed: cannot open the connection
Warning messages:
1: In normalizePath(path) :
  path[1]="/home/docker/BH_1.65.0-1.tar.gz": No such file or directory
2: In read.dcf(path) :
  cannot open compressed file '/home/docker/BH_1.65.0-1.tar.gz/DESCRIPTION', probable reason 'No such file or directory'
1 Like

Interestingly, your example (devtools::install_github("sailthru/tidyjson")) worked nicely for me.
My original example of install.packages("sjPlot") however still fails.

As of now, I'm leaving that as is, as per JennyBryan reaffirming my "it's really early, just wait a while"-suspicion.

RStudio Cloud attempts to cache package binaries installed from CRAN to improve install time performance. There is a known issue where sometimes these cached binaries are not compatible with the compiled version of we're running. We have it on our backlog to improve this. In the meantime, installing from GitHub is good work around.

1 Like

Hi, I'm having problems to install ggplot2 dev version from github in the Rstudio Cloud. Could someone give me some hint how to solve this problem?

devtools::install_github('tidyverse/ggplot2')

It returns an error:

Downloading GitHub repo tidyverse/ggplot2@master
from URL https://api.github.com/repos/tidyverse/ggplot2/zipball/master
Installing ggplot2
Installation failed: cannot open the connection
Warning messages:
1: In normalizePath(path) :
  path[1]="/tmp/work/assertthat.tar.gz": No such file or directory
2: In read.dcf(path) :
  cannot open compressed file '/tmp/work/assertthat.tar.gz/DESCRIPTION', probable reason 'No such file or directory'

Thanks!

It's a bit odd that devtools is attempting to use the temp directory /tmp/work. Do you have any customized settings? Perhaps in your RProfile or Renvrion files?

1 Like

Hi, Andy! Thank you for your reply. I don't have any customized settings and there are no custom RProfile or Renviron in the project.

I was able to manually install the package.

Thank you.

1 Like

I see this as well. Just tried to start up a fresh cloud session and install dev reticulate.

> devtools::install_github("rstudio/reticulate")
Downloading GitHub repo rstudio/reticulate@master
from URL https://api.github.com/repos/rstudio/reticulate/zipball/master
Installing reticulate
Installation failed: cannot open the connection
Warning messages:
1: In normalizePath(path) :
  path[1]="/tmp/work/jsonlite.tar.gz": No such file or directory
2: In read.dcf(path) :
  cannot open compressed file '/tmp/work/jsonlite.tar.gz/DESCRIPTION', probable reason 'No such file or directory'

The problem happens within devtools:::package_deps(). Specifically the line:

remote <- structure(lapply(deps, package2remote, repos = repos, 
    type = type), class = "remotes")

package2remote calls the utils function, packageDescription(). This is what returns the tmp/work directory.

You can see this by just running packageDescription("jsonlite", lib.loc = .libPaths()) after installing devtools (which downloads jsonlite) and looking at the returned RemoteURL field.

Update 1)

It seems this might have to do with the fact that you guys mask install.packages(). packageDescription() get's the package details from a package Meta file that already exists (it seems to be created at pkg installation time). I'd imagine somewhere this got messed up?

> install.packages
function (...) 
.rs.callAs(name, hook, original, ...)
<environment: 0x5635821304b0>

Update 2)

After a bit of sleuthing, something may be wrong with the cached version of the package you guys seem to try and install from this proxy repo.

> getOption("repos")
                  CRAN 
"http://package-proxy" 

If I do:

options(repos = "https://cran.rstudio.com/" )

then:

utils::install.packages("jsonlite")

then I'm able to install dev reticulate with no issues.

4 Likes

Hi davis! Excellent sleuthing!

We've identified this as a problem with how we are building packages for that cache, and will work on a solution.

Thank you for the great reprex!

3 Likes

I'm seeing the same behavior if I try and install anything on rstudio.cloud from github that depends on Rcpp:

devtools::install_github("hadley/devtools")
# Downloading GitHub repo hadley/devtools@master
# from URL https://api.github.com/repos/hadley/devtools/zipball/master
# Installing devtools
# Installation failed: cannot open the connection
# Warning messages:
# 1: In normalizePath(path) :
#  path[1]="/tmp/work/Rcpp.tar.gz": No such file or directory
# 2: In read.dcf(path) :
#  cannot open compressed file '/tmp/work/Rcpp.tar.gz/DESCRIPTION', probable reason 'No such file or 
#  directory'

I tried tried the workaround from @davis where he sets the repos. But no luck. Is there an intermediate workaround before the full fix is complete?

Did you try to do utils::install_packages("Rcpp") after changing the repo?

Try that then install from GitHub. Repeat for any package that shows up in the warning

ohhhh... Yeah I didn't realize I needed to reinstall previously installed packages after setting the repo. I had to do a few iterations to install all dependencies manually, but ultimately this worked:


options(repos = "https://cran.rstudio.com/" )

utils::install.packages("Rcpp")
utils::install.packages("stringi")
utils::install.packages("stringr")

devtools::install_github("hadley/devtools")

Thanks for the help, @davis!

2 Likes

hi!

A fix to these cache packages has now been deployed, thank you all for reporting!

Please note that the install.packages('sjPlot') issue at the top of the thread is a separate issue, and due to a missing system dependency, is still not functioning.

3 Likes

Actually, sjPlot is having issues because TMB uses too much memory and the build process gets killed.

We have added the TMB and glmmTMB packages to our cache of pre-built packages, and they should now be able to be installed successfully, and therefore sjPlot as well.

I faced same issue which is all packages unable install via devtools...

> devtools::install_github("hadley/devtools")
Downloading GitHub repo hadley/devtools@master
from URL https://api.github.com/repos/hadley/devtools/zipball/master
Installing devtools
Installation failed: cannot open the connection
Warning messages:
1: In normalizePath(path) :
  path[1]="/tmp/work/assertthat.tar.gz": No such file or directory
2: In read.dcf(path) :
  cannot open compressed file '/tmp/work/assertthat.tar.gz/DESCRIPTION', probable reason 'No such file or directory'

@englianhu if you reinstall your packages that issue should clear up

1 Like

FYI: I have just run this bit-o-setup with no heartache whatsoever...

install.packages("tidyverse")
install.packages("devtools")
devtools::install_github("omarwagih/ggseqlogo")
devtools::install_github("rstudio/keras")
library("keras")
install_keras()

reinstall all warning packages and devtools really works although everytime need to manually do it once see the warning packages (it is not user friendly but at least can install packages from Github)...

devtools::install_github('r-lib/devtools') same as well.