Problems installing devtool package

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I create one? Using a reprex, complete with representative data will attract quicker and more answers. Not needed for this type of question--there's enough to go on.

There are three possibilities that jump to the front of the rope line.

  1. Anaconda. I love Anaconda for many reasons, not the least of which is that it's a fabulous package manager for Python. Alas, it appears from many problems raised here, not so much for R.

  2. Missing XCode command line tools (OR a permissions problem), as evidenced by

The fix for the latter is to run with administrator privileges

$ sudo R
...
> install.packages(...)

after, of course, disabling Anaconda package manager ('tho I've never had to do this, since I've never used conda for R)

If it's that there's just no compiler, the fix is pretty simple. Download the free XCode app from the App Store, then

$ xcode-select --install

That may still not work depending on

  1. On macOS, packages sometimes fail to install, often with a non-zero exit status message. This is due to Apple's idiosyncratic compiler. The same packages will install on most Linux systems without trouble. Saint Simon Urbanek of the R Core Development Team takes on the brain damage required to recode the source to get around macOS's peculiar worldview for those in CRAN, but he can't bestow the same mercy on those still in development.

Some packages will successfully install through compilation from source, but many won't.

When installing if you are offered the option to install from source, it makes sense to try it once. But, if at first it doesn't succeed, in all likelihood it never will. It's usually only 7-10 days until a macOS binary is available

1 Like