Cannot install R conda packages on Apple Mac M2

584 Views Asked by At

I can't seem to install R conda packages although it is available on conda.

For example, r-raster;

$ mamba install -c conda-forge r-raster

Looking for: ['r-raster']

conda-forge/osx-arm64                                       Using cache
conda-forge/noarch                                          Using cache

Pinned packages:
  - python 3.11.*


Could not solve for environment specs
The following package could not be installed

Non R packages seem to install fine. Am I missing something?

R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20.0.0 (64-bit)
Running under: macOS Ventura 13.5

conda 23.5.0
1

There are 1 best solutions below

0
On

The r-raster builds for osx-arm64 depend on r-terra, which has unresolved issues building. Until that is fixed, Conda Forge cannot provide r-raster for osx-arm64. I happen to be one of the maintainers on it, but simply don't have the time to spend on patching the autoconf script to supporting cross-compilation. If anyone wants to help get that build working, please send a PR.

In the meantime, one can also emulate osx-64 environments, as indicated in this answer. For example, something like

CONDA_SUBDIR=osx-64 conda create -n foo r-base=4.2 r-raster