Hi there,
I wonder if anyone can help me solve an issue I'm having with install_github.
Whether I use remotes::install_github
or devtools::install_github
, I get the following error message that reads "System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr":
devtools::install_github("DenaJGibbon/gibbonR-package")
Downloading GitHub repo DenaJGibbon/gibbonR-package@HEAD
The system cannot find the path specified.
√ checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d83d647a58\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ...
- preparing 'gibbonR':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'gibbonR_0.0.0.9000.tar.gz'
Error: Failed to install 'gibbonR' from GitHub:
System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> The system cannot find the path specified.
E> * checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d83d647a58\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ... OK
E> * preparing 'gibbonR':
E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> * building 'gibbonR_0.0.0.9000.tar.gz'
E>
I thought this had to do with my path specifications and devtools/rtools, so in the end I did a fresh install of rtools and the whole setup procedure. Here's my system and path specs, and what I did:
- Windows 10 64-bit and R Studio Version 1.4.1103
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.2
year 2020
month 06
day 22
svn rev 78730
language R
version.string R version 4.0.2 (2020-06-22)
nickname Taking Off Again
-
Downloaded Rtools (rtools40-x86_64.exe) from https://cran.r-project.org/bin/windows/Rtools/
-
Added Rtools to my path, which now looks like:
> writeLines(strsplit(Sys.getenv("PATH"), ";")[[1]])
C:\Program Files\R\R-4.0.2\bin\x64
C:\Program Files\R\R-4.0.2\bin\x64
C:\rtools40\usr\bin
C:\rtools40\mingw64\bin
-
For good measure, created an .Renviron file in C:\Users\Ava\Documents, that includes the line PATH=${RTOOLS40_HOME}\usr\bin;${PATH} Exactly as shown - but I wasn't sure if I should have pasted the path to Rtools in the first variable...)
-
Checking that Rtools is recognized:
> Sys.which("make")
make
"C:\\rtools40\\usr\\bin\\make.exe"
> pkgbuild::check_rtools(TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE
> pkgbuild::has_rtools(TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE
> pkgbuild::has_build_tools(debug=TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE
> devtools::find_rtools(debug=TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE
# After manually adding C:\rtools40\mingw64\bin to a new env variable BINPREF:
> Sys.getenv("BINPREF")
[1] "C:\\rtools40\\mingw64\\bin"
Yet, calls to devtools still fails with the same error message. I also don't understand this since Rcmd.exe is indeed on the path, at C:\Program Files\R\R-4.0.2\bin\x64
> devtools::install_github("DenaJGibbon/gibbonR-package", build_vignettes = FALSE)
Downloading GitHub repo DenaJGibbon/gibbonR-package@HEAD
The system cannot find the path specified.
√ checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpYHUJJi\remotes5f8032964d86\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ...
- preparing 'gibbonR':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'gibbonR_0.0.0.9000.tar.gz'
Error: Failed to install 'gibbonR' from GitHub:
System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> The system cannot find the path specified.
E> * checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpYHUJJi\remotes5f8032964d86\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ... OK
E> * preparing 'gibbonR':
E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> * building 'gibbonR_0.0.0.9000.tar.gz'
E>
Now, it turns out the package I'm trying to download might not be available for R 4.0.2 (which I only found out by trying:
> pkgbuild::with_build_tools(install.packages("DenaJGibbon/gibbonR-package", type = "source"))
Installing package into ‘C:/Users/Ava/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘DenaJGibbon/gibbonR-package’ is not available (for R version 4.0.2)
But the error persists, since other packages that are available for 4.0 throw the same error:
devtools::install_github('hadley/ggplot2')
Downloading GitHub repo hadley/ggplot2@HEAD
The system cannot find the path specified.
√ checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d86e2e12ee\tidyverse-ggplot2-dbd7d79/DESCRIPTION' ...
- preparing 'ggplot2': (1.7s)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts (952ms)
- checking for empty or unneeded directories
- building 'ggplot2_3.3.3.9000.tar.gz'
Error: Failed to install 'ggplot2' from GitHub:
System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> The system cannot find the path specified.
E> * checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d86e2e12ee\tidyverse-ggplot2-dbd7d79/DESCRIPTION' ... OK
E> * preparing 'ggplot2':
E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> * building 'ggplot2_3.3.3.9000.tar.gz'
E>
Any ideas on how to resolve this?
Update: Thinking it might have to do with permissions to access the temporary directiroy, I tried running this from RStudio opened as admin, but problem persisted.
Update 2: Following up, I also tried adding a new temporary directory, and specifying this in both the .Renviron file and a new Renviron.site in C:\Users\Ava\Documents (TMPDIR = C:\rtemp). RStudio run as admin still threw same errors.
Update 3: Thinking it may have come from the fact that I had two versions of R installed (3.6 and 4.0), I uninstalled R 3.6, restarted R, but same error when I tried with devtools::install_github("rmcelreath/rethinking")
.
Update 4: I tried adding the Rcmd.exe file directly to the path, still no luck:
\usr\bin
C:\Program Files\R\R-4.0.2\bin\x64
C:\Program Files\R\R-4.0.2\bin\x64
C:\Program Files\R\R-4.0.2\bin\x64\Rcmd.exe
C:\rtools40\usr\bin
C:\rtools40\mingw64\bin
Update 5: I remove Anaconda from my path, thinking a possible duplicate of R executable might be causing the problem, still no luck.
Update 6, OneDrive is not causing the problem, as it persists even when not working in a OneDrive folder, sync is paused and OneDrive is closed.
Thanks,