Search code examples
rwindowsdevtools

Problems installing packages devtools and callr on Windows


Installing package devtools I obtained the following message

There are binary versions available but the source versions are later:
         binary source needs_compilation
processx  3.3.1  3.4.0              TRUE
callr     3.2.0  3.3.0             FALSE

Moreover:

* installing *source* package 'callr' ...
** package 'callr' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = 
vI[[j]]) : 
namespace 'processx' 3.3.1 is being loaded, but >= 3.4.0 is required

and

ERROR: lazy loading failed for package 'callr'
* removing 'C:/Users/Standard/Documents/R/win-library/3.6/callr'
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status

Then I tried to update processx package, hoping that it could fix the problem:

install.packages("processx")
library(processx)

RStudio asked me to restart R session but then

> install.packages("devtools")
ERROR: lazy loading failed for package 'callr'
* removing 'C:/Users/Standard/Documents/R/win-library/3.6/callr'
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status

What am I doing wrong?

EDIT I tried with installing processx and callr with their dependencies in this way

install.packages("processx", dependencies=TRUE)
library(processx)
install.packages("callr", dependencies=TRUE)
library(callr)

but I obtained the message:

Error in library(callr) : there is no package called ‘callr’

Solution

  • I had same problem. I think your problem is, that latest Rtools version needs to be installed. Devtools will install properly including dependencies to callr and processx after Rtools is installed. So do the following:

    1. Delete the callr and processx and devtools packages from your library folder under your Rversion folder.
    2. Close Rstudio or R shell.
    3. Download recommended version from this site: https://cran.r-project.org/bin/windows/Rtools/ Follow instructions here: http://jtleek.com/modules/01_DataScientistToolbox/02_10_rtools/#6
    4. After rtools and then devtools are installed, check with find_rtools() if TRUE

    Now callr and processx should be installed also as you can see in your library folder.