Certain R packages will not install properly on my Windows 10 computer. For example, if I install.packages('callr') The result is trying URL 'https://cloud.r-project.org/src/contrib/callr_3.4.0.tar.gz' Content type 'application/x-gzip' length 100129 bytes (97 KB) downloaded 97 KB Warning: invalid package 'C:\Users\David' Warning: invalid package 'Stevens\AppData\Local\Temp\Rtmpk5NqrI/downloaded_packages/callr_3.4.0.tar.gz' Error: ERROR: no packages specified Warning in install.packages : installation of package ?callr? had non-zero exit status The downloaded source packages are in ?C:\Users\David Stevens\AppData\Local\Temp\Rtmpk5NqrI\downloaded_packages? both using RStudio 1.2.5019 and the Rgui.exe 3.6.2. I look in the download folder and the callr_3.4.0.tar.gz is there but the installer can't find it. This happens on only a subset of packages I install or update. I assume the cause is the space in my name in the c:\users folder. I've been unable to locate the environment variable or registry value that routes the tar.gz files to this location. Any ideas on how to fix this? This is a relatively recent issue (i.e. I never saw it before November - I've used R for ~15 years). Best regards David Stevens [[alternative HTML version deleted]]
Apparently it does not like that the fact that your user 'David Stevens' has a blank. Looking at the documentation ?install.packages it seems that if you modify your call to something like install.packages('callr',destdir='C:\tmp') you might be ok. (caveat: I did not try this) You should make the directory C:\tmp (or whatever you use instead) before you issue this call. HTH, Eric On Thu, Dec 12, 2019 at 5:48 PM David Stevens <david.stevens at usu.edu> wrote:> > Certain R packages will not install properly on my Windows 10 computer. For example, if I > > install.packages('callr') > > The result is > > trying URL 'https://cloud.r-project.org/src/contrib/callr_3.4.0.tar.gz' > Content type 'application/x-gzip' length 100129 bytes (97 KB) > downloaded 97 KB > > Warning: invalid package 'C:\Users\David' > Warning: invalid package 'Stevens\AppData\Local\Temp\Rtmpk5NqrI/downloaded_packages/callr_3.4.0.tar.gz' > Error: ERROR: no packages specified > Warning in install.packages : > installation of package ?callr? had non-zero exit status > > The downloaded source packages are in > ?C:\Users\David Stevens\AppData\Local\Temp\Rtmpk5NqrI\downloaded_packages? > > both using RStudio 1.2.5019 and the Rgui.exe 3.6.2. I look in the download folder and the callr_3.4.0.tar.gz is there but the installer can't find it. This happens on only a subset of packages I install or update. I assume the cause is the space in my name in the c:\users folder. I've been unable to locate the environment variable or registry value that routes the tar.gz files to this location. Any ideas on how to fix this? This is a relatively recent issue (i.e. I never saw it before November - I've used R for ~15 years). > > Best regards > > David Stevens > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Thanks Eric - I had tried this and failed with install.packages('callr',destdir='c:/myRLib') Installing package into ?C:/myRLib? (as ?lib? is unspecified) There is a binary version available but the source version is later: binary source needs_compilation callr 3.3.2 3.4.0 FALSE installing the source package ?callr? trying URL 'https://cloud.r-project.org/src/contrib/callr_3.4.0.tar.gz' Content type 'application/x-gzip' length 100129 bytes (97 KB) downloaded 97 KB * installing *source* package 'callr' ... ** package 'callr' successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading Fatal error: cannot open file 'C:\Users\David': No such file or directory ERROR: lazy loading failed for package 'callr' * removing 'C:/myRLib/callr' Warning in install.packages : installation of package ?callr? had non-zero exit status I also tried install.packages('callr',lib='c:/myRLib',destdir='c:/myRLib') with the same result. There's something more here that I'm unable to discover. Best David On 12/12/2019 8:56 AM, Eric Berger wrote: Apparently it does not like that the fact that your user 'David Stevens' has a blank. Looking at the documentation ?install.packages it seems that if you modify your call to something like install.packages('callr',destdir='C:\tmp') you might be ok. (caveat: I did not try this) You should make the directory C:\tmp (or whatever you use instead) before you issue this call. HTH, Eric On Thu, Dec 12, 2019 at 5:48 PM David Stevens <david.stevens at usu.edu><mailto:david.stevens at usu.edu> wrote: Certain R packages will not install properly on my Windows 10 computer. For example, if I install.packages('callr') The result is trying URL 'https://cloud.r-project.org/src/contrib/callr_3.4.0.tar.gz' Content type 'application/x-gzip' length 100129 bytes (97 KB) downloaded 97 KB Warning: invalid package 'C:\Users\David' Warning: invalid package 'Stevens\AppData\Local\Temp\Rtmpk5NqrI/downloaded_packages/callr_3.4.0.tar.gz' Error: ERROR: no packages specified Warning in install.packages : installation of package ?callr? had non-zero exit status The downloaded source packages are in ?C:\Users\David Stevens\AppData\Local\Temp\Rtmpk5NqrI\downloaded_packages? both using RStudio 1.2.5019 and the Rgui.exe 3.6.2. I look in the download folder and the callr_3.4.0.tar.gz is there but the installer can't find it. This happens on only a subset of packages I install or update. I assume the cause is the space in my name in the c:\users folder. I've been unable to locate the environment variable or registry value that routes the tar.gz files to this location. Any ideas on how to fix this? This is a relatively recent issue (i.e. I never saw it before November - I've used R for ~15 years). Best regards David Stevens [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. On 12/12/2019 8:56 AM, Eric Berger wrote: Apparently it does not like that the fact that your user 'David Stevens' has a blank. Looking at the documentation ?install.packages it seems that if you modify your call to something like install.packages('callr',destdir='C:\tmp') you might be ok. (caveat: I did not try this) You should make the directory C:\tmp (or whatever you use instead) before you issue this call. HTH, Eric On Thu, Dec 12, 2019 at 5:48 PM David Stevens <david.stevens at usu.edu><mailto:david.stevens at usu.edu> wrote: Certain R packages will not install properly on my Windows 10 computer. For example, if I install.packages('callr') The result is trying URL 'https://cloud.r-project.org/src/contrib/callr_3.4.0.tar.gz' Content type 'application/x-gzip' length 100129 bytes (97 KB) downloaded 97 KB Warning: invalid package 'C:\Users\David' Warning: invalid package 'Stevens\AppData\Local\Temp\Rtmpk5NqrI/downloaded_packages/callr_3.4.0.tar.gz' Error: ERROR: no packages specified Warning in install.packages : installation of package ?callr? had non-zero exit status The downloaded source packages are in ?C:\Users\David Stevens\AppData\Local\Temp\Rtmpk5NqrI\downloaded_packages? both using RStudio 1.2.5019 and the Rgui.exe 3.6.2. I look in the download folder and the callr_3.4.0.tar.gz is there but the installer can't find it. This happens on only a subset of packages I install or update. I assume the cause is the space in my name in the c:\users folder. I've been unable to locate the environment variable or registry value that routes the tar.gz files to this location. Any ideas on how to fix this? This is a relatively recent issue (i.e. I never saw it before November - I've used R for ~15 years). Best regards David Stevens [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- 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 at usu.edu<mailto:david.stevens at usu.edu> [[alternative HTML version deleted]]
On Thu, 12 Dec 2019 15:48:13 +0000 David Stevens <david.stevens at 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(). -- Best regards, Ivan
Ivan - thanks for looking into this. My answers to your comments are below. Cheers David On 12/13/2019 1:46 AM, Ivan Krylov wrote: On Thu, 12 Dec 2019 15:48:13 +0000 David Stevens <david.stevens at usu.edu><mailto:david.stevens at 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? Too many to name - one is nlstools. Another is tinytex. I updated many package after bookdown wouldn't install for the same reasons. Out of a list of ~20 packages to install, ~5 failed with a similar error message. That sent me down the rabbit hole that brought me here. 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: I read a thread elsewhere that said a work around is to run options(pkgType='binary') before installation and the problem went away. Does this help. 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? Yes, this is the case. I do the regular Windows 10 updates and update R and RStudio as soon as I am aware there's a new version out. I haven't explicitly change %USERPROFILE%. 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: tempdir() gives tempdir() [1] "C:\\Users\\David Stevens\\AppData\\Local\\Temp\\RtmpQpqh0t">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(). Thanks for looking into this. -- 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 at usu.edu<mailto:david.stevens at usu.edu> [[alternative HTML version deleted]]
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 at usu.edu><mailto:david.stevens at 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 at usu.edu<mailto:david.stevens at usu.edu> [[alternative HTML version deleted]]