Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System command error when utilizing install_github #2031

Closed
MorningGlory747 opened this issue Apr 17, 2019 · 11 comments
Closed

System command error when utilizing install_github #2031

MorningGlory747 opened this issue Apr 17, 2019 · 11 comments

Comments

@MorningGlory747
Copy link

MorningGlory747 commented Apr 17, 2019

Greetings,

I am fairly new to R but with experience in python and matlab.

Current setup :
> version

> platform       x86_64-w64-mingw32          
> arch           x86_64                      
> os             mingw32                     
> system         x86_64, mingw32             
> status                                     
> major          3                           
> minor          5.3                         
> year           2019                        
> month          03                          
> day            11                          
> svn rev        76217                       
> language       R                           
> version.string R version 3.5.3 (2019-03-11)
> nickname       Great Truth      

Also, using RStudio-1.2.1335

And downloaded Rtools35.exe from https://cran.r-project.org/bin/windows/Rtools/. After downloaded, I simply followed the installation instructions and left it like that afterwards.

Context
I initially wanted to download the Tealeaves package (see https://github.com/cdmuir/tealeaves). To do so, I inputed the following commands in a new session of RStudio

> install.packages("devtools")
> devtools::install_github("cdmuir/tealeaves")

But I then received the following error message:

Error message
> devtools::install_github("cdmuir/tealeaves")

> Downloading GitHub repo cdmuir/tealeaves@master
> √  checking for file 'C:\Users\****\AppData\Local\Temp\Rtmp8eEyUw\remotes3c0c529a4d46\cdmuir-tealeaves-a306691/DESCRIPTION' (748ms)
> -  preparing 'tealeaves': (1.3s)
> √  checking DESCRIPTION meta-information ... 
> -  checking for LF line-endings in source and make files and shell scripts (642ms)
> -  checking for empty or unneeded directories
> -  looking to see if a 'data/datalist' file should be added
> -  building 'tealeaves_0.0.9.tar.gz'
>    
> Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
>   System command error

I also received this same error message when trying out other packages, such as:
> devtools::install_github("r-lib/devtools")

> Downloading GitHub repo r-lib/devtools@master
> √  checking for file 'C:\Users\****\AppData\Local\Temp\Rtmp8eEyUw\remotes3c0c79014129\r-lib-devtools-f7cd462/DESCRIPTION' (1.3s)
> -  preparing 'devtools': (3.2s)
> √  checking DESCRIPTION meta-information ... 
> -  checking for LF line-endings in source and make files and shell scripts (1s)
> -  checking for empty or unneeded directories
> -  building 'devtools_2.0.2.9000.tar.gz'
>    
> Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
>   System command error

And also

devtools::install_github("r-lib/remotes")

> Downloading GitHub repo r-lib/remotes@master
> √  checking for file 'C:\Users\****\AppData\Local\Temp\Rtmp8eEyUw\remotes3c0c845ae\r-lib-remotes-1f657ec/DESCRIPTION' (702ms)
> -  preparing 'remotes': (2s)
> √  checking DESCRIPTION meta-information ... 
> -  checking for LF line-endings in source and make files and shell scripts (532ms)
> -  checking for empty or unneeded directories
> -  building 'remotes_2.0.4.9000.tar.gz'
>    Warning: file 'remotes/tests/testthat/archives/foo/configure' did not have execute permissions: corrected
>    
> Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
>   System command error

Which lead me to believe that this is something fundamentally wrong with how I am doing things.

Attempts to fix things
rtools and path:

When google searching for this Error in (function (command = NULL, args = character(), error_on_status = TRUE, : message, one mentions that it could be related to an improper rtools version.

To verify that I have a proper version, I did :

> library(devtools)
> find_rtools(T)
Scanning R CMD config CC...
cc_path: c:/Rtools/mingw_64/bin/gcc 
install_path: c:/Rtools 
VERSION.txt
Rtools version 3.5.0.4 
Found compatible gcc from R CMD config CC
[1] TRUE

Interestingly enough, I do receive the following prompt when trying to install this :

devtools::install_github("sneumann/xcms")

Building R package from source requires installation of additional build tools
Do you want to install the additional tooks now?
I can either pick yes or no.

Researching this message lead me to here (rstudio/tensorflow#133) and the last comment mentions that there is something in my setup that is preventing me from using the compiler and that this could be related to how my paths are organised. This is a level of complexity which goes beyond me however and the best I can do is the following :

> Sys.getenv()['PATH']

PATH                                        C:\Program
                                            Files\R\R-3.5.3\bin\x64;C:\Rtools\bin;C:\RBuildTools\3.5\bin;C:\Rtools\bin;C:\Program
                                            Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
                                            Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;

But we can see that rtools is present in the R path.

unzip :

Many have had issues with install_github and unzip. I wanted to believe that this was related because the error message appears right after the building '****.tar.gz' so maybe it had something to do with the unzipping.
However, doing


> getOption("unzip")
> [1] "internal

Seems to be the expected behavior of unzip so perhaps nothing wrong there.

As such, I have difficulties figuring out what the issue could be. Is it possible to receive any help on this matter?

Cheers,

@ldemaz
Copy link

ldemaz commented Apr 30, 2019

I am also getting a similar error. This is a new problem on a package that I built with R3.5.0, but just upgraded to R3.6.0, which is when the problems have started. The error occurs with devtools::install_github, devtools::install, and when running Build > check from the Rstudio GUI. The problem seems to occur with a particular chunk in one particular vignette, which uses raster::mask:

chirpsz <- mask(x = chirps, mask = districts)

set.seed(1)
ind <- sample(1:nlayers(chirpsz), size = 3)
plot(chirpsz[[ind]], axes = FALSE, box = FALSE, nr = 1)

The consistent error message from the build process (e.g. devtools::install(build_vignettes = TRUE)) is:

  Quitting from lines 415-421 (unit2-module2.Rmd) 
   Error: processing vignette 'unit2-module2.Rmd' failed with diagnostics:
   incorrect number of layer names
   --- failed re-building ‘unit2-module2.Rmd’

The vignette will knit successfully from the Rstudio GUI, or rmarkdown::render

SessionInfo() when the package in question is attached:

R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

other attached packages:
 [1] geospaar_0.2.3  forcats_0.4.0   stringr_1.4.0  
 [4] dplyr_0.8.0.1   purrr_0.3.2     readr_1.3.1    
 [7] tidyr_0.8.3     tibble_2.1.1    ggplot2_3.1.1  
[10] tidyverse_1.2.1 sf_0.7-4        raster_2.8-19  
[13] sp_1.3-1       

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1         cellranger_1.1.0   plyr_1.8.4        
 [4] pillar_1.3.1       compiler_3.6.0     class_7.3-15      
 [7] tools_3.6.0        lubridate_1.7.4    jsonlite_1.6      
[10] nlme_3.1-139       gtable_0.3.0       lattice_0.20-38   
[13] pkgconfig_2.0.2    rlang_0.3.4        cli_1.1.0         
[16] DBI_1.0.0          rstudioapi_0.10    haven_2.1.0       
[19] e1071_1.7-1        withr_2.1.2        xml2_1.2.0        
[22] httr_1.4.0         hms_0.4.2          generics_0.0.2    
[25] classInt_0.3-3     grid_3.6.0         tidyselect_0.2.5  
[28] glue_1.3.1         R6_2.4.0           readxl_1.3.1      
[31] modelr_0.1.4       magrittr_1.5       backports_1.1.4   
[34] scales_1.0.0       codetools_0.2-16   units_0.6-2       
[37] rvest_0.3.3        assertthat_0.2.1   colorspace_1.4-1  
[40] KernSmooth_2.23-15 stringi_1.4.3      lazyeval_0.2.2    
[43] munsell_0.5.0      broom_0.5.2        crayon_1.3.4 

@rileytwo
Copy link

@MorningGlory747, I think you need to fix some things in your PATH. I had a similar issue as well that I posted to r-lib/pkgbuild.

My path looks like this (Sys.getenv('PATH')):

[1] "C:\\Program Files\\R\\R-3.5.3\\bin\\x64;C:\\Python37\\Scripts\\;C:\\Python37\\;C:\\Rtools\\bin\\;C:\\Rtools\\mingw_64\\bin\\;

You need to include C:\Rtools\mingw_64\bin\ in your path (or 32 rather than 64 if you're using a 32-bit version of R). The PATH should list C:\Rtools\bin\; and C:\Rtools\mingw_64\bin\; right next to one another. Your path has C:\RBuildTools\bin\ following C:\Rtools\bin\:

C:\Program Files\R\R-3.5.3\bin\x64;C:\Rtools\bin;C:\RBuildTools\3.5\bin;C:\Rtools\bin;

I see that find_rtools(T) returns cc_path which shows c:/Rtools/mingw_64/bin/gcc, but I believe this still needs to be in your PATH.

library(devtools)
find_rtools(T)

Scanning R CMD config CC...
cc_path: c:/Rtools/mingw_64/bin/gcc
install_path: c:/Rtools
VERSION.txt
Rtools version 3.5.0.4
Found compatible gcc from R CMD config CC
[1] TRUE

The last thing I think you need to do is add BINPREF to your system environment variables.

Sys.getenv('BINPREF')
[1] "C:/Rtools/mingw_64/bin/"

You need to use foward slashes / rather than backslashes \. When I tried to run find_rtools(T) with backslashes, cc_path was printed as c:Rtoolsmingw_64bingcc.

Let me know if any of this helps!

@MorningGlory747
Copy link
Author

MorningGlory747 commented May 1, 2019

@livelaughriley Hey thanks for the help. Unfortunately, it does not seem like the changes to the path do any good :(

To ensure that I have properly followed the instructions, here is an outlook of the results:

Sys.getenv('PATH')
"C:\\Program Files\\R\\R-3.5.3\\bin\\x64;C:\\Rtools\\bin;C:\\Rtools\\mingw_64\\bin\\;[...]"

I've removed C:\RBuildTools\bin\ from the path since you don't seem to be showing it but that also didn't change anything.

I've tried putting both C:\Rtools\bin and C:\Rtools\mingw_64\bin\ either in the PATH of the user or the system environment but in either case the issue persists.

Also,

> library(devtools)
> find_rtools(T)
Scanning R CMD config CC...
cc_path: C:/Rtools/mingw_64/bin/gcc 
install_path: C:/Rtools 
VERSION.txt
Rtools version 3.5.0.4 
Found compatible gcc from R CMD config CC
[1] TRUE

Which gives the same output as you.

And, for BINPREF

> Sys.getenv('BINPREF')
[1] "C:/Rtools/mingw_64/bin/"

Which also gives the same output as you.

What do you think? Thank you!

@rileytwo
Copy link

rileytwo commented May 1, 2019

Not a problem! Happy to help.

Take a look at this issue I posted to r-lib/pkgbuild: r-lib/pkgbuild#72 (comment). The link should take you to the post where I ended up finding out how to solve my problem. My issue ended up being a system command error--completely unrelated to R--although any system commands coming from R were affected.

Looking at the final line of your error, you'll see System command error.

Downloading GitHub repo cdmuir/tealeaves@master
√ checking for file 'C:\Users\****\AppData\Local\Temp\Rtmp8eEyUw\remotes3c0c529a4d46\cdmuir-tealeaves-a306691/DESCRIPTION' (748ms)
- preparing 'tealeaves': (1.3s)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts (642ms)
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'tealeaves_0.0.9.tar.gz'

Error in (function (command = NULL, args = character(), error_on_status = TRUE, :
System command error

Hopefully my issue at pkgbuild can help you diagnose your problem. If not, try looking at this: r-lib/pkgbuild#72 (comment). The person who helped me had a similar problem, although the source of the error was different.

@MorningGlory747
Copy link
Author

@livelaughriley haha yes it looks like your correction was it! I had my autorun set with a default color so that my terminal would open up with a white background with a blue font. It's mighty impressive that you were able to figure out that this was the problem, seeing as it was a system command rather than a r-related problem was a great diagnostic! It looks like i'll be able to work with R now, but I wonder what i'll do about my terminal background color now xD.

In any case, thanks so much for your help!

@rileytwo
Copy link

rileytwo commented May 2, 2019

No problem at all! I'm glad I could help 😄.

@kubistmi
Copy link

You are amazing @livelaughriley !
I had this problem for quite some time now, absolutely unable to localize the problem (solely looking around my R installation and PATH variable).
In the end, it was a previous conda installation that broke the Autorun for me.
Thank you very much!

@rileytwo
Copy link

i appreciate the kind words, @kubistmi!

@ingrideut
Copy link

Please Could you help me? I am trying to clone a package git but i have the following massage as well as this error:

install('aquacropr')
√ checking for file 'C:\Users\Ingrid\Documents\R\win-library\EX\aquacropr/DESCRIPTION' ...

  • preparing 'AquaCropR': (399ms)
    √ checking DESCRIPTION meta-information ...
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'AquaCropR_0.0.0.9000.tar.gz'

Running "C:/PROGRA1/R/R-361.1/bin/x64/Rcmd.exe" INSTALL "C:\Users\INGRID~1\AppData\Local\Temp\Rtmp0SYjqD/AquaCropR_0.0.0.9000.tar.gz" --install-tests

  • installing to library 'C:/Users/Ingrid/Documents/R/win-library/3.6'
  • installing source package 'AquaCropR' ...
    ** using staged installation
    -arning in file(file, if (append) "a" else "w") :
    cannot open file 'C:/Users/Ingrid/Documents/R/win-library/3.6/00LOCK-AquaCropR/00new/AquaCropR/DESCRIPTION': No such file or directory
    Error in file(file, if (append) "a" else "w") :
    cannot open the connection
    ERROR: installing package DESCRIPTION failed for package 'AquaCropR'
  • removing 'C:/Users/Ingrid/Documents/R/win-library/3.6/AquaCropR'
    Error in (function (command = NULL, args = character(), error_on_status = TRUE, :
    System command error

@rileytwo
Copy link

@ingrideut have you checked to see if you have any lock files/directories in C:/Users/Ingrid/Documents/R/win-library/3.6/?

@lock
Copy link

lock bot commented Apr 15, 2020

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/

@lock lock bot locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants