Cannot install devtools (and Rtools) from CRAN

Hello,

While other packages are installed without problem so far, installation of devtools fails. I'm using Rstudio 1.2.5033, and R version 3.6.3 on Windows 10.
Here's what I get:

> install.packages("devtools")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\fs01/users/asafsa/R/win-library/3.6’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
         binary source needs_compilation
devtools  2.2.2  2.3.0             FALSE

installing the source package ‘devtools’

trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.3.0.tar.gz'
Content type 'application/x-gzip' length 375227 bytes (366 KB)
downloaded 366 KB

'\\fs01\users\asafsa'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in findpack(package, lib.loc) : 
  there is no package called 'devtools'
Calls: <Anonymous> -> findpack
Execution halted
ERROR: lazy loading failed for package 'devtools'
* removing '\\fs01/users/asafsa/R/win-library/3.6/devtools'
Warning in install.packages :
  installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\asafsa\AppData\Local\Temp\RtmpGMYxFi\downloaded_packages’

Having read the first warning, I tried to install Rtools, but that failed too:

> install.packages("Rtools")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘\\fs01/users/asafsa/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘Rtools’ is not available (for R version 3.6.3)

What can I do with that, other than downgrading my R version?

Thanks!

R has problems with network drives, I recommend you to set your library on a local path instead

Rtools is not an R package is a separate software that you have to download and install

https://cran.r-project.org/bin/windows/Rtools/

1 Like

Thanks, @andresrcs!

I've installed Rtools, and changed my default library which should now be the first on the following list, I believe:

> .libPaths()
[1] "C:/Program Files/R/R-3.6.3/library"      "\\\\fs01/users/asafsa/R/win-library/3.6"
[3] "C:/R_custom_library"       

The error message is different now, but installing devtools still doesn't work:

> install.packages("devtools")
Installing package into ‘C:/Program Files/R/R-3.6.3/library’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
         binary source needs_compilation
devtools  2.2.2  2.3.0             FALSE

installing the source package ‘devtools’

trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.3.0.tar.gz'
Content type 'application/x-gzip' length 375227 bytes (366 KB)
downloaded 366 KB

'\\fs01\users\asafsa'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package 'usethis' required by 'devtools' could not be found
Execution halted
ERROR: lazy loading failed for package 'devtools'
* removing 'C:/Program Files/R/R-3.6.3/library/devtools'
Warning in install.packages :
  installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\asafsa\AppData\Local\Temp\RtmpWiYX76\downloaded_packages’

What's going on now?

Thanks, Asaf

Have you tried installing the missing dependency?

install.packages("usethis")

I had that dependency already installed on the network library (‘\fs01/users/asafsa/R/win-library/3.6’). Following your response I installed it also into my local library (‘C:/Program Files/R/R-3.6.3/library’). Now I have another dependency that is similarly "missing":

> install.packages("devtools")
Installing package into ‘C:/Program Files/R/R-3.6.3/library’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
         binary source needs_compilation
devtools  2.2.2  2.3.0             FALSE

installing the source package ‘devtools’

trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.3.0.tar.gz'
Content type 'application/x-gzip' length 375227 bytes (366 KB)
downloaded 366 KB

'\\fs01\users\asafsa'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for 'usethis' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called 'fs'
Error: package 'usethis' could not be loaded
Execution halted
ERROR: lazy loading failed for package 'devtools'
* removing 'C:/Program Files/R/R-3.6.3/library/devtools'
Warning in install.packages :
  installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\asafsa\AppData\Local\Temp\RtmpWiYX76\downloaded_packages’

Does it make sense to migrate all of my packages to the local library, then, and stop using the network drive altogether? If so, will cutting and pasting the folder contents between these locations outside R do the job?

Yes, that would make things way easier for you.

Yes

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