Package 'backports' always problematic
When installing rrtools with devtools::install_github("benmarwick/rrtools"), there is always a problem with the installation of backports.
This is what I did (in a clean install of R, after installing the packages I need, including devtools):
Downloading GitHub repo benmarwick/rrtools@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: jsonlite (1.6.1 -> 1.7.0) [CRAN]
5: backports (1.1.7 -> 1.1.8) [CRAN]
6: knitr (1.28 -> 1.29 ) [CRAN]
7: DT (0.13 -> 0.14 ) [CRAN]
Enter one or more numbers, or an empty line to skip updates: 2
RCurl (NA -> 1.98-1.2) [CRAN] jsonlite (1.6.1 -> 1.7.0 ) [CRAN] clisymbols (NA -> 1.2.0 ) [CRAN] bookdown (NA -> 0.20 ) [CRAN] here (NA -> 0.1 ) [CRAN] backports (1.1.7 -> 1.1.8 ) [CRAN] knitr (1.28 -> 1.29 ) [CRAN] DT (0.13 -> 0.14 ) [CRAN] bitops (NA -> 1.0-6 ) [CRAN] Installing 9 packages: RCurl, jsonlite, clisymbols, bookdown, here, backports, knitr, DT, bitops
There are binary versions available but the source versions are later:
binary source needs_compilation
jsonlite 1.6.1 1.7.0 TRUE
bookdown 0.19 0.20 FALSE
backports 1.1.7 1.1.8 TRUE
knitr 1.28 1.29 FALSE
DT 0.13 0.14 FALSE
[I did not want to install from source with compilation because this can lead to problems with the package renv if the user does not have Rtools installed.]
package ‘RCurl’ successfully unpacked and MD5 sums checked package ‘jsonlite’ successfully unpacked and MD5 sums checked package ‘clisymbols’ successfully unpacked and MD5 sums checked package ‘here’ successfully unpacked and MD5 sums checked package ‘backports’ successfully unpacked and MD5 sums checked Error: Failed to install 'rrtools' from GitHub: (converted from warning) cannot remove prior installation of package ‘backports’
Then I tried again:
devtools::install_github("benmarwick/rrtools")
Downloading GitHub repo benmarwick/rrtools@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: jsonlite (1.6.1 -> 1.7.0) [CRAN]
5: knitr (1.28 -> 1.29 ) [CRAN]
6: DT (0.13 -> 0.14 ) [CRAN]
Enter one or more numbers, or an empty line to skip updates: 1
jsonlite (1.6.1 -> 1.7.0) [CRAN] bookdown (NA -> 0.20 ) [CRAN] backports (NA -> 1.1.8) [CRAN] knitr (1.28 -> 1.29 ) [CRAN] DT (0.13 -> 0.14 ) [CRAN] bitops (NA -> 1.0-6) [CRAN] Installing 6 packages: jsonlite, bookdown, backports, knitr, DT, bitops
There are binary versions available but the source versions are later: binary source needs_compilation jsonlite 1.6.1 1.7.0 TRUE bookdown 0.19 0.20 FALSE backports 1.1.7 1.1.8 TRUE knitr 1.28 1.29 FALSE DT 0.13 0.14 FALSE [This time I agreed to compile.]
...
package ‘bitops’ successfully unpacked and MD5 sums checked
...
installing source package 'jsonlite' ...
...
DONE (jsonlite)
installing source package 'backports' ...
package 'backports' successfully unpacked and MD5 sums checked
using staged installation
libs
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsElt.c -o dotsElt.o
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsLength.c -o dotsLength.o
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
c:/rtools40/mingw64/bin/gcc -shared -s -static-libgcc -o backports.dll tmp.def dotsElt.o dotsLength.o init.o -LC:/PROGRA~1/R/R-40~1.2/bin/x64 -lR
installing to C:/Program Files/R/R-4.0.2/library/00LOCK-backports/00new/backports/libs/x64
R
byte-compile and prepare package for lazy loading
help
installing help indices
converting help for package 'backports'
finding HTML links ... done
R_user_dir html
URLencode html
anyNA html
backports-package html
capture.output html
dQuote html
deparse1 html
dir.exists html
dotsElt html
dotsLength html
endsWith html
file.info html
file.size html
get0 html
hasName html
import html
isFALSE html
isTRUE html
lengths html
list2DF html
startsWith html
strrep html
trimws html
valid.factor html
vignetteInfo html
warningCondition html
building package indices
testing if installed package can be loaded from temporary location
Error in file.rename(instdir, final_instdir) :
(converted from warning) cannot rename file 'C:/Program Files/R/R-4.0.2/library/00LOCK-backports/00new/backports' to 'C:/Program Files/R/R-4.0.2/library/backports', reason 'Access is denied'
removing 'C:/Program Files/R/R-4.0.2/library/backports'
Error: Failed to install 'rrtools' from GitHub:
(converted from warning) installation of package ‘backports’ had non-zero exit status
So I tried
install.packages("backports")
There is a binary version available but the source version is later: binary source needs_compilation backports 1.1.7 1.1.8 TRUE [Agreed to compile again]
installing the source package ‘backports’
trying URL 'https://ftp.fau.de/cran/src/contrib/backports_1.1.8.tar.gz'
Content type 'application/x-gzip' length 18047 bytes (17 KB)
downloaded 17 KB
installing source package 'backports' ...
package 'backports' successfully unpacked and MD5 sums checked
using staged installation
libs
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsElt.c -o dotsElt.o
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c dotsLength.c -o dotsLength.o
"c:/rtools40/mingw64/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
c:/rtools40/mingw64/bin/gcc -shared -s -static-libgcc -o backports.dll tmp.def dotsElt.o dotsLength.o init.o -LC:/PROGRA~1/R/R-40~1.2/bin/x64 -lR
installing to C:/Program Files/R/R-4.0.2/library/00LOCK-backports/00new/backports/libs/x64
R
byte-compile and prepare package for lazy loading
help
installing help indices
converting help for package 'backports'
finding HTML links ... done
R_user_dir html
URLencode html
anyNA html
backports-package html
capture.output html
dQuote html
deparse1 html
dir.exists html
dotsElt html
dotsLength html
endsWith html
file.info html
file.size html
get0 html
hasName html
import html
isFALSE html
isTRUE html
lengths html
list2DF html
startsWith html
strrep html
trimws html
valid.factor html
vignetteInfo html
warningCondition html
building package indices
testing if installed package can be loaded from temporary location
Warning in file.rename(instdir, final_instdir) :
cannot rename file 'C:/Program Files/R/R-4.0.2/library/00LOCK-backports/00new/backports' to 'C:/Program Files/R/R-4.0.2/library/backports', reason 'Access is denied'
ERROR: moving to final location failed
removing 'C:/Program Files/R/R-4.0.2/library/backports'
The downloaded source packages are in
‘...\AppData\Local\Temp\RtmpkRwL1m\downloaded_packages’
Warning message:
In install.packages("backports") :
installation of package ‘backports’ had non-zero exit status
I could not remove the package with remove.packages("backports") so I manually deleted the folder from the library directory.
After that, I reinstalled backports with compilation (and it worked), and then installing rrttools went smoothly.
Long story short: backports needs to be installed before rrtools and not during the installation.
I have tried, on a clean install, to install backports (without compilation) first and then rrtools (without updating, i.e. emtpy line) and this went smoothly.
This is probably an issue with backports, but I think that it should be at least mentioned for the installation of rrtools.
Thank you, could you update your first post with your session info please? Thanks.
Ha, yes, sorry, I forgot. Note that it is my current sessionInfo(), but except for the packages installed, it is the same as the sessionInfo() when trying to install rrtools. Also note that I have loaded rrtools before calling sessionInfo(), I thought it would be more useful.
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rrtools_0.1.0
loaded via a namespace (and not attached):
[1] bookdown_0.20 here_0.1 clisymbols_1.2.0 crayon_1.3.4 digest_0.6.25
[6] rprojroot_1.3-2 backports_1.1.7 git2r_0.27.1 evaluate_0.14 rlang_0.4.6
[11] curl_4.3 fs_1.4.1 rstudioapi_0.11 rmarkdown_2.3 tools_4.0.2
[16] glue_1.4.1 tinytex_0.24 xfun_0.15 compiler_4.0.2 htmltools_0.5.0
[21] knitr_1.29 usethis_1.6.1
I'll close this for now since it's been some time since there was any discussion. Let us know if it pops up again!