[R] Errors in R package installation

David Stevens d@v|d@@teven@ @end|ng |rom u@u@edu
Fri Dec 13 14:19:54 CET 2019


Ivan

Here's a longer list. RStudio checked for what needs updating, I select all of them, and enter. The following is the console output (FYI - I tried this in plain Rgui.exe and got the same result - I don't think it's an RStudio issue). The failed installs are toward the bottom.

Best

David

> install.packages(c("callr", "cli", "data.table", "english", "exactRankTests", "glmnet", "leafpop", "lmerTest", "multcomp", "plyr", "quantreg", "R.utils", "renv", "RgoogleMaps", "rmarkdown", "satellite", "SparseM", "tinytex"), lib = "C:/Users/David Stevens/Documents/R/win-library/3.6")

  There are binary versions available but the source versions are
  later:
          binary source needs_compilation
lmerTest   3.1-0  3.1-1             FALSE
quantreg    5.52   5.54              TRUE
rmarkdown   1.18    2.0             FALSE
SparseM     1.77   1.78              TRUE

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/callr_3.4.0.zip'
Content type 'application/zip' length 356928 bytes (348 KB)
downloaded 348 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/cli_2.0.0.zip'
Content type 'application/zip' length 392358 bytes (383 KB)
downloaded 383 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/data.table_1.12.8.zip'
Content type 'application/zip' length 2277502 bytes (2.2 MB)
downloaded 2.2 MB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/english_1.2-4.zip'
Content type 'application/zip' length 134736 bytes (131 KB)
downloaded 131 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/exactRankTests_0.8-31.zip'
Content type 'application/zip' length 168031 bytes (164 KB)
downloaded 164 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/glmnet_3.0-2.zip'
Content type 'application/zip' length 1823093 bytes (1.7 MB)
downloaded 1.7 MB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/leafpop_0.0.5.zip'
Content type 'application/zip' length 1910754 bytes (1.8 MB)
downloaded 1.8 MB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/multcomp_1.4-11.zip'
Content type 'application/zip' length 730724 bytes (713 KB)
downloaded 713 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/plyr_1.8.5.zip'
Content type 'application/zip' length 1306165 bytes (1.2 MB)
downloaded 1.2 MB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/R.utils_2.9.2.zip'
Content type 'application/zip' length 1411713 bytes (1.3 MB)
downloaded 1.3 MB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/renv_0.9.2.zip'
Content type 'application/zip' length 820084 bytes (800 KB)
downloaded 800 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/RgoogleMaps_1.4.5.zip'
Content type 'application/zip' length 479429 bytes (468 KB)
downloaded 468 KB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/satellite_1.0.2.zip'
Content type 'application/zip' length 3227758 bytes (3.1 MB)
downloaded 3.1 MB

trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.6/tinytex_0.18.zip'
Content type 'application/zip' length 101040 bytes (98 KB)
downloaded 98 KB

package ‘callr’ successfully unpacked and MD5 sums checked
package ‘cli’ successfully unpacked and MD5 sums checked
package ‘data.table’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot remove prior installation of package ‘data.table’
Warning in install.packages :
  problem copying C:\Users\David Stevens\Documents\R\win-library\3.6\00LOCK\data.table\libs\x64\datatable.dll to C:\Users\David Stevens\Documents\R\win-library\3.6\data.table\libs\x64\datatable.dll: Permission denied
Warning in install.packages :
  restored ‘data.table’
package ‘english’ successfully unpacked and MD5 sums checked
package ‘exactRankTests’ successfully unpacked and MD5 sums checked
package ‘glmnet’ successfully unpacked and MD5 sums checked
package ‘leafpop’ successfully unpacked and MD5 sums checked
package ‘multcomp’ successfully unpacked and MD5 sums checked
package ‘plyr’ successfully unpacked and MD5 sums checked
package ‘R.utils’ successfully unpacked and MD5 sums checked
package ‘renv’ successfully unpacked and MD5 sums checked
package ‘RgoogleMaps’ successfully unpacked and MD5 sums checked
package ‘satellite’ successfully unpacked and MD5 sums checked
package ‘tinytex’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\David Stevens\AppData\Local\Temp\RtmpkLEdno\downloaded_packages
installing the source packages ‘lmerTest’, ‘quantreg’, ‘rmarkdown’, ‘SparseM’

trying URL 'https://cloud.r-project.org/src/contrib/lmerTest_3.1-1.tar.gz'
Content type 'application/x-gzip' length 194447 bytes (189 KB)
downloaded 189 KB

trying URL 'https://cloud.r-project.org/src/contrib/quantreg_5.54.tar.gz'
Content type 'application/x-gzip' length 995368 bytes (972 KB)
downloaded 972 KB

trying URL 'https://cloud.r-project.org/src/contrib/rmarkdown_2.0.tar.gz'
Content type 'application/x-gzip' length 3186667 bytes (3.0 MB)
downloaded 3.0 MB

trying URL 'https://cloud.r-project.org/src/contrib/SparseM_1.78.tar.gz'
Content type 'application/x-gzip' length 735024 bytes (717 KB)
downloaded 717 KB

Warning: invalid package 'C:\Users\David'
Warning: invalid package 'Stevens\AppData\Local\Temp\RtmpkLEdno/downloaded_packages/lmerTest_3.1-1.tar.gz'
Error: ERROR: no packages specified
Warning in install.packages :
  installation of package ‘lmerTest’ had non-zero exit status
Warning: invalid package 'C:\Users\David'
Warning: invalid package 'Stevens\AppData\Local\Temp\RtmpkLEdno/downloaded_packages/rmarkdown_2.0.tar.gz'
Error: ERROR: no packages specified
Warning in install.packages :
  installation of package ‘rmarkdown’ had non-zero exit status
Warning: invalid package 'C:\Users\David'
Warning: invalid package 'Stevens\AppData\Local\Temp\RtmpkLEdno/downloaded_packages/SparseM_1.78.tar.gz'
Error: ERROR: no packages specified
Warning in install.packages :
  installation of package ‘SparseM’ had non-zero exit status
Warning: invalid package 'C:\Users\David'
Warning: invalid package 'Stevens\AppData\Local\Temp\RtmpkLEdno/downloaded_packages/quantreg_5.54.tar.gz'
Error: ERROR: no packages specified
Warning in install.packages :
  installation of package ‘quantreg’ had non-zero exit status

The downloaded source packages are in
        ‘C:\Users\David Stevens\AppData\Local\Temp\RtmpkLEdno\downloaded_packages’


>
On 12/13/2019 1:46 AM, Ivan Krylov wrote:

On Thu, 12 Dec 2019 15:48:13 +0000
David Stevens <david.stevens using usu.edu><mailto:david.stevens using usu.edu> wrote:



Certain R packages will not install properly on my Windows 10
computer.



Certain, but not all? Which packages are you able to install on that
computer?



Warning: invalid package 'C:\Users\David'
Warning: invalid package
'Stevens\AppData\Local\Temp\Rtmpk5NqrI/downloaded_packages/callr_3.4.0.tar.gz'



This looks like a command line argument quoting issue.

I wonder why doesn't install.packages use shQuote to quote the file
name when calling system2(c("R", "CMD", "INSTALL", file)) to install a
downloaded source package:

https://github.com/wch/r-source/blob/e554f7f12b22868bdae51aadaeea4d56c9f87a32/src/library/utils/R/packages2.R#L833

Maybe there should be shQuote(fil) instead, especially since R does
quote the file name when installing from local source tarballs:

https://github.com/wch/r-source/blob/e554f7f12b22868bdae51aadaeea4d56c9f87a32/src/library/utils/R/packages2.R#L676



This happens on only a subset of packages I install or update.



I have a hypothesis: perhaps this only happens for packages with no
pre-built Windows binary available yet, since "win.binary" packages may
be installed by unpacking a zip file, without calling a command line
with potential space quoting issues:

https://github.com/wch/r-source/blob/e554f7f12b22868bdae51aadaeea4d56c9f87a32/src/library/utils/R/packages2.R#L491
->
https://github.com/wch/r-source/blob/e554f7f12b22868bdae51aadaeea4d56c9f87a32/src/library/utils/R/windows/install.packages.R#L263

Calling install.packages(..., verbose = TRUE) for both a succeeding and
a failing package might help to verify whether this is the case.



This is a relatively recent issue (i.e. I never saw it before
November - I've used R for ~15 years).



Just to confirm it: you had no problems on the same Windows 10 computer
with the same user name and %USERPROFILE% path as before? Apparently,
tempdir() used to return a 8.3 directory path on your computer, but now
doesn't - but that should not happen, since R_reInitTempDir()
explicitly asks for a 8.3 path:

https://github.com/wch/r-source/blob/e554f7f12b22868bdae51aadaeea4d56c9f87a32/src/main/sysutils.c#L1810

Microsoft Docs page for GetShortPathName() says:



If you call GetShortPathName on a path that doesn't have any short
names on-disk, the call will succeed, but will return the long-name
path instead. This outcome is also possible with NTFS volumes
because there's no guarantee that a short name will exist for a
given long name.



Some newer Windows 10 installations may have
NtfsDisable8dot3NameCreation enabled, thus preventing R from getting a
8.3 path to the temp directory.

I am taking the liberty of Cc-ing R-devel because this might warrant
adding a shQuote() call to install.packages().



--
David K Stevens, PhD, PE
Environmental Engineering Division
Civil and Environmental Engineering
Utah State University
8200 Old Main Hill
Logan, UT 83200-8200
(435) 797-3229
david.stevens using usu.edu<mailto:david.stevens using usu.edu>

	[[alternative HTML version deleted]]



More information about the R-help mailing list