Error Installing Package from Binaries on Windows -- 'cp: unknown option -- )'

2,407 views
Skip to first unread message

Jotham Apaloo

unread,
Feb 11, 2015, 5:12:48 PM2/11/15
to rdev...@googlegroups.com
Hi,

I am trying to install a package locally and getting the error at the bottom of the post.

I have reproduced this with another package and on another machine. On that other machine I have used install_local, I think then the devtools was an earlier version. All other conditions I think were the same.

I have also seen http://stackoverflow.com/questions/18114308/getting-g-error-when-installing-r-code-from-source, which seems to be a good reference. I tried all the solutions, except for changing the R path variable. Does he mean path to R.exe in the system environment variables? Or a system variable in the R environment?

Any other suggestions for troubleshooting this?

Thanks in advance

> library('devtools')
> install_local("T:\\tidyr_0.2.0.zip")
Installing tidyr
Installing dependencies for tidyr:
stringi
--- Please select a CRAN mirror for use in this session ---
trying URL
'http://cran.utstat.utoronto.ca/bin/windows/contrib/3.1/stringi_0.4-1.zip'
Content type 'application/zip' length 13436804 bytes (12.8 Mb)
opened URL
downloaded
12.8 Mb

package stringi successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        D
:\Users\jotham.apaloo\AppData\Local\Temp\RtmpaejBo2\downloaded_packages
"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" --vanilla CMD INSTALL  \
 
"D:/Users/jotham.apaloo/AppData/Local/Temp/RtmpaejBo2/devtools3fe468f87904/tidyr" --library="C:/Program  \
  Files/R/R-3.1.0/library"
--install-tests

* installing *binary* package 'tidyr' ...
cp
: unknown option -- )
Try `/usr/bin/cp --help' for more information.
Warning:
 running command 'cp -R . "C:/Program Files/R/R-3.1.0/library/tidyr" || (
 tar cd - .| (cd "C:/Program Files/R/R-3.1.0/library/tidyr" &&
tar -xf -))' had status 1
ERROR: installing binary package failed
* removing 'C:/Program Files/R/R-3.1.0/library/tidyr'
Error: Command failed (1)

Stacktrace
10: stop("Command failed (", status, ")", call. = FALSE)
9: system_check(r_path, options, c(r_env_vars(), env_vars), ...)
8: force(code)
7: in_dir(path, system_check(r_path, options, c(r_env_vars(), env_vars),
       
...))
6: R(paste("CMD INSTALL ", shQuote(built_path), " ", opts, sep = ""),
       quiet
= quiet)
5: install(source, ..., quiet = quiet)
4: FUN(X[[1L]], ...)
3: vapply(remotes, install_remote, ..., FUN.VALUE = logical(1))
2: install_remotes(remotes, ...)
1: install_local("T:\\tidyr_0.2.0.zip")



sessionInfo
()

## R version 3.1.0 (2014-04-10)
## Platform: x86_64-w64-mingw32/x64 (64-bit)

## locale:
## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

## other attached packages:
## [1] devtools_1.7.0

## loaded via a namespace (and not attached):
## [1] tools_3.1.0


Hadley Wickham

unread,
Feb 13, 2015, 3:40:48 PM2/13/15
to Jotham Apaloo, rdev...@googlegroups.com
If it fails to find cp, then something has gone wrong with your Rtools install.

What does devtools::find_rtools(TRUE) report?

Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rdevtools+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://had.co.nz/

Jotham Apaloo

unread,
Feb 17, 2015, 3:00:36 PM2/17/15
to rdev...@googlegroups.com, jotham...@gmail.com
devtools::find_rtools(debug=TRUE)
Scanning path...
ls
: c:\Rtools\bin\ls.exe
gcc
: c:\Rtools\GCC-46~1.3\bin\gcc.exe
VERSION
.txt
Rtools version 3.1.0.1942
Version: 3.1
[1] TRUE

rtools seems to be OK...

Prateek Maheshwari

unread,
Mar 26, 2016, 4:14:11 AM3/26/16
to devtools, jotham...@gmail.com
Hi,

Did you come across a solution for the same?
Facing a similar issue.

Regards,
Prateek

Erdogan Cevher

unread,
Apr 9, 2017, 12:01:06 PM4/9/17
to devtools, jotham...@gmail.com
Prateek, I faced the same problem.

I could not solve the problem, but suspecting what it could be.

I meddled in default.options in R setup, and made auto-install of some of my preferred packages. Once I deleted one of the such auto-installed packages from the library location, Revo R Ent got mad.

I think the problem was caused by the fact that we meddled the original setup much.

Regards,


12 Şubat 2015 Perşembe 01:12:48 UTC+3 tarihinde Jotham Apaloo yazdı:

Erdogan Cevher

unread,
Apr 9, 2017, 1:23:36 PM4/9/17
to devtools, jotham...@gmail.com
The solution below worked for me:
https://support.rstudio.com/hc/en-us/community/posts/222201687-Some-question-about-building-package-by-R-studio-

You have a field called 'Built:' in your package's DESCRIPTION file;
R normally tries to inject that field itself when it builds your package from sources.


I deleted "Built"'s line in DESCRIPTION and then installed again. This time, no error appeared.

12 Şubat 2015 Perşembe 01:12:48 UTC+3 tarihinde Jotham Apaloo yazdı:
Hi,
Reply all
Reply to author
Forward
0 new messages