Repository navigation
Installing dependencies fails on Windows (which occurs with dev version) #1191
Description
Installing dependencies fails on my local Windows environment with dev version of devtools package.
devtools::install_github("sinhrks/ggfortify", dependencies = TRUE, force = TRUE)
#> Downloading GitHub repo sinhrks/ggfortify@master
#> from URL https://api.github.com/repos/sinhrks/ggfortify/zipball/master
#> Installing ggfortify
#> trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/dlm_1.1-4.zip'
#> Content type 'application/zip' length 550878 bytes (537 KB)
#> downloaded 537 KB
#>
#> Installing dlm
#> "C:/PROGRA~1/R/R-33~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
#> "C:/Users/user1/AppData/Local/Temp/RtmpCcjLkl/devtools251477d67687/dlm" --library="C:/Users/user1/Documents/R/win-library/3.3" \
#> --install-tests
#>
#> * installing *binary* package 'dlm' ...
#> cp: unknown option -- )
#> Try '/usr/bin/cp --help' for more information.
#> Warning: running command 'cp -R . "C:/Users/user1/Documents/R/win-library/3.3/dlm" || ( internal cd - .| (cd "C:/Users/user1/Documents/R/win-library/3.3/dlm" && internal -xf -))' had status 1
#> ERROR: installing binary package failed
#> * removing 'C:/Users/user1/Documents/R/win-library/3.3/dlm'
#> Error: Command failed (1)I've dived into the R source code. This code
Warning: running command 'cp -R . "C:/Users/user1/Documents/R/win-library/3.3/dlm" || ( internal cd - .| (cd "C:/Users/user1/Documents/R/win-library/3.3/dlm" && internal -xf -))' had status 1
is from around here.
res <- system(paste("cp -R .", shQuote(instdir),
"|| (", TAR, "cd - .| (cd", shQuote(instdir), "&&", TAR, "-xf -))"
))But it says this do_install_binary() is for Unix only. This means something is wrong that this part of code is executed on Windows platform.
The correct way of installing binary packages on Windows platform seems to be using ZIP archive without decompressing. I suspect the problem is that install_remote() does not follow the way; it seems to ALWAYS decompress() package archives, around here
Could you consider adding condition branch for Windows?
Session info:
sessionInfo()
#> R version 3.3.0 (2016-05-03)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows >= 8 x64 (build 9200)
#>
#> locale:
#> [1] LC_COLLATE=Japanese_Japan.932 LC_CTYPE=Japanese_Japan.932 LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C
#> [5] LC_TIME=Japanese_Japan.932
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] httr_1.1.0 R6_2.1.2 tools_3.3.0 withr_1.0.1 curl_0.9.7 memoise_1.0.0
#> [7] git2r_0.15.0 digest_0.6.9 devtools_1.11.1.9000
Activity
jimhester commentedon May 25, 2016
I feel like this is really a bug / shortcoming in R, in that you cannot install binary package on Windows once it is extracted.
Nonetheless #1192 fixes your example and should fix the issue.
yutannihilation commentedon May 25, 2016
Thanks!
I feel the same as you. This is more like a bug in R...
hadley commentedon Jun 2, 2016
Fixed by #1192
yutannihilation commentedon Jun 2, 2016
I've confirmed. Thanks! 👍
saritha080 commentedon Jun 19, 2017
Im trying to install SparkR on 64 bit windows with R3.3.2. Facing the same error while trying to install SparkR through devtools from command line as:
%SPARK_HOME%\R\lib\SparkR>R -e "devtools::install ('.')"
Warning: running command 'cp -R . "C:/Users/HP/Documents/R/win-library/3.3/Spark
R" || ( internal cd - .| (cd "C:/Users/HP/Documents/R/win-library/3.3/SparkR" &&
internal -xf -))' had status 1
ERROR: installing binary package failed
Error: Command failed (1)
Execution halted
I read the previous posts where this seems to be fixed. Which release is this available? How can I continue with my installation?
hariramn commentedon Nov 6, 2017
Hi @saritha080 any luck resolving this?
lock commentedon Sep 17, 2018
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/