Error message related to macOS binary package

Dear Community

I receive the following message when trying to install the 'did' package via RStudio:

Error: file ‘/var/folders/kx/l9yp3b293ln6q3bw249w8ydm0000gn/T//RtmpgPZC9T/downloaded_packages/clock_0.7.3.tgz’ is not a macOS binary package

Further warnings() are:
`There were 31 warnings (use warnings() to see them)

warnings()
Warning messages:
1: In download.file(urls, destfiles, "libcurl", mode = "wb", ... :
URL 'https://stat.ethz.ch/CRAN/bin/macosx/big-sur-arm64/contrib/4.5/clock_0.7.3.tgz': status was 'Failure when receiving data from the peer'
2: In download.file(urls, destfiles, "libcurl", mode = "wb", ... :
URL 'https://stat.ethz.ch/CRAN/bin/macosx/big-sur-arm64/contrib/4.5/hardhat_1.4.2.tgz': status was 'Transferred a partial file'
....
30: In download.file(urls, destfiles, "libcurl", mode = "wb", ... :
URL 'https://stat.ethz.ch/CRAN/bin/macosx/big-sur-arm64/contrib/4.5/labeling_0.4.3.tgz': status was 'Error in the HTTP2 framing layer'
31: In download.file(urls, destfiles, "libcurl", mode = "wb", ... :
some files were not downloaded`

Downloading other packages, e.g., jsonlite works.

I downloaded R via R for macOS and use conda/miniconda to work with python in environments.

The command which curl outputs /usr/bin/curl (which seems to be correct.)

The command echo $PATH outputs:
➜ ~ echo $PATH /opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/opt/X11/bin:/Applications/iTerm.app/Contents/Resources/utilities

As I cannot find the source of the problem, does the information provided suggest any potential fix to you?

I remain available for any further information needed.

Thank you,
Linda F. O.

In general conda does not mix well with R from CRAN (or anything else, really). Either install R from conda, or deactivate conda while you use R.

Now the error message might be for a different reason, actually, but the first step is to make sure you are not mixing conda and CRAN R, anyway.

Dear Gabor,

Thank you very much for your assistance. Although I am not 100% sure of the solution, the problem seems to be resolved.

In case someone encounters a similar problem in the future, or if this is of interest to you, here is what may have caused it:

Possible causes:

  • (as you mentioned) Incompatibility between conda and R from CRAN
  • Issues with gfortran and macOS

What may have resolved the issue (possibly in combination):

As I am not very experienced with this, do you have any good references on best practices and clean workflows when using R from CRAN together with conda environments?