Troubles to install packages with renv. Mac M1 Pro

Hello, I have to create a new project for school and use renv to install all the packages needed for the modules.

First of all, I am on Mac M1 Pro and I uninstalled and reinstalled the last versions of R and RStudio.

When I do renv::install() to install all the packages I got this error message when it tries to install the first one:

Installing packages --------------------------------------------------------

  • Installing MASS ... FAILED
    Error in if (cond) return(expr) : the condition has length > 1
    In addition: Warning messages:
    1: /usr/bin/xcrun --find --show-sdk-path returned exit code 1
    2: In system2(R(), args, stdout = TRUE, stderr = TRUE) :
    running command ''/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R' CMD config CC 2>&1' had status 1

However when I do utils::install.packages("yaml") to install one of the needed packages, in the renv session, it works and after I don't need to install this package. But I have to install a hundred of packages so I'm not going to do it for every one...

I don't understand this error.

If someone can give me some help...

Thank you !

I think you don't have tools to compile packages from source. Install the XCode command line tools.

Hey

Thank you very much for your response !
I installed Xcode command line tools on my Mac and now it works I can install packages with renv.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.