Open hirokisince1998 opened 4 years ago
Hi, did you ever solve this? I am also unable to install rstan on Google Colab.
Hi, I've install V8 via command line and after that install rstan, see the notebook here. Sorry, it's too overexplained, bcs for students)
Right. system("apt-get install -y libv8-dev")
does the trick.
However, install.packages("rstan")
takes unacceptably long time (some 15 minutes) for every colab instances, which makes its use for remote lecture almost impossible.
Still waiting for an update.
If you're installing RStan and all its dependencies in a fresh R instance on Colab (i.e., with no dependencies already installed), then it is naturally going to take a while. This is because RStan and its dependencies (and their dependencies) are being installed from source, which requires compilation for many packages. This is not an RStan issue, just a reality of installing packages on Linux distributions (which is what Colab uses).
You can speed up the compilation of packages by instructing R to use all available cores when building packages.
Simply run:
Sys.setenv(MAKEFLAGS= paste0("-j",parallel::detectCores()))
Before installing RStan
Summary:
RStan installation on Google Colaboratory now fails.
Description:
"apt install r-cran-rstan" suddenly stopped working. On Google Colaboratory, the following script is expected to set up a working RStan environment, as described in Installing RStan on Linux.
However, the last step now fails, so the following "library(rstan)" also fails.
Reproducible Steps:
Open a notebook with: https://colab.research.google.com/notebook#create=true&language=r
Run the following code:
Current Output:
R Version:
R version 3.6.3 (2020-02-29)
Operating System:
Running on Google Colaboratory with IRkernel