Closed guillaumecharbonnier closed 2 years ago
I am not doing anything R-specific in the setup. Does Colab ship their own R runtime too? I guess we need to do some patching in that case so it uses conda's R?
Yes, Colab ships their own R runtime. But what I always use is the default runtime with the Rmagic. Most packages can be installed the R way, but mamba is way faster. Here is an example with the issue at the bottom of the notebook: https://colab.research.google.com/drive/17qG00WaqIPCrRtwYeC7omKUMAi4v1xMj?usp=sharing
I see. We might need to install R from scratch using conda/mamba too, and hope it replaces everything already in Colab.
I am planning a refactor where we stop depending on the shipped packages though, so everything is added by us and we don't have to cross our fingers for ABI compatibility. This would make the R case way simpler.
That said, I don't have an ETA for that. Let's leave this open for now so we can target it in the future.
If you want to debug this in the meantime, this is what I would do:
%%R
calls and make sure that the interpreter called here is the one in the conda environment (you might need to patch or symlink files).Also, take into account that a current limitation is that we can't add new environments. If you want to use an environment file, you should use conda env update -n base -f environment.yml
.
Thanks for your tips, it is actually super easy to fix this issue by ensuring mamba also install and overwrite rpy2 in the base environment. I have updated the notebook linked above accordingly. Most of my colab notebooks have just got a ~30-minute computation time decrease. \o/
Awesome! I'll add a note to the README.
Is it possible to install R packages using condacolab, then load these packages inside %%R cells?
If I try it I get this error: