s-jSDM icon indicating copy to clipboard operation
s-jSDM copied to clipboard

install to google colab / kaggle

Open chnpenny opened this issue 4 years ago • 4 comments

Hey, I wanna install sjSDM to google colab. But I get this error message. I don't know if it's easy to fix but better to check with you. Error: Failed to install 'sjSDM' from GitHub: (converted from warning) installation of package ‘/tmp/RtmpJEcT8x/file436a79464/sjSDM_0.1.3.9000.tar.gz’ had non-zero exit status Traceback:

  1. devtools::install_github("https://github.com/TheoreticalEcology/s-jSDM", . subdir = "sjSDM", auth_token = "xxxxxxx")
  2. pkgbuild::with_build_tools({ . ellipsis::check_dots_used(action = getOption("devtools.ellipsis_action", . rlang::warn)) . { . remotes <- lapply(repo, github_remote, ref = ref, subdir = subdir, . auth_token = auth_token, host = host) . install_remotes(remotes, auth_token = auth_token, host = host, . dependencies = dependencies, upgrade = upgrade, force = force, . quiet = quiet, build = build, build_opts = build_opts, . build_manual = build_manual, build_vignettes = build_vignettes, . repos = repos, type = type, ...) . } . }, required = FALSE)
  3. install_remotes(remotes, auth_token = auth_token, host = host, . dependencies = dependencies, upgrade = upgrade, force = force, . quiet = quiet, build = build, build_opts = build_opts, build_manual = build_manual, . build_vignettes = build_vignettes, repos = repos, type = type, . ...)
  4. tryCatch(res[[i]] <- install_remote(remotes[[i]], ...), error = function(e) { . stop(remote_install_error(remotes[[i]], e)) . })
  5. tryCatchList(expr, classes, parentenv, handlers)
  6. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  7. value[3L]

chnpenny avatar Feb 02 '21 22:02 chnpenny

Hi, how do you run R in google colab? I thought they only supported python?

MaximilianPi avatar Feb 03 '21 16:02 MaximilianPi

Hey, There's two ways to use R in google colab. (see https://towardsdatascience.com/how-to-use-r-in-google-colab-b6e02d736497). I tried to install sjsdm in both R and python (followed by your python installation). Both of the them give an error when trying to install a compressed file. I don't know it's a security issue from google or it's actually sth that you can try to fix?

chnpenny avatar Feb 03 '21 21:02 chnpenny

Hi, devtools::install doesn't work for me either, I then cloned the repository via git (!git clone ...) and was finally able to install the package via install.package("s-jSDM/sjSDM", repos=NULL). However, the bad news - the session crashes every time I try to load the package, I realized pretty quikly that the problem seems to be with the reticulate package, when running reticulat::py_config() the session crashes. So I am not sure if it's worth the time to get it somehow to run (if it is even possible). CanI ask why you want to use colab? Because of the remote resources / runtime?

MaximilianPi avatar Feb 03 '21 22:02 MaximilianPi

Question from a user about install instructions for a kaggle R notebook:

  1. turn on the internet connection of the kaggle notebook (which means that you have to verify your account https://www.kaggle.com/product-feedback/63544)
  2. sjSDM installation: i. devtools::install_github("https://github.com/TheoreticalEcology/s-jSDM", subdir = "sjSDM", dep=FALSE) # dep = FALSE is important! ii. sjSDM::install_sjSDM(version="gpu”) # will throw an error but still run it iii. reticulate::conda_install(packages=c("torch torchvision torchaudio pyro-ppl torch_optimizer"), pip = TRUE)
  3. sjSDM should run now

MaximilianPi avatar Jun 17 '21 16:06 MaximilianPi