2

On windows 10, RStudio. I've tried using the command install.packages, but it aways appear this messages:

> install.packages ("stringi")
 There is a binary version available but the source version is later:
        binary source needs_compilation
stringi  1.4.6  1.5.3              TRUE

installing the source package ‘stringi’

trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.5.3.tar.gz'
Content type 'application/x-gzip' length 7293930 bytes (7.0 MB)
downloaded 7.0 MB

* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
** using staged installation
** libs
C:/Users/Natusha/Google Drive (natusha.alirr@gmail.com)/R/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/Natusha/GOOGLE~2.COM/R/R-36~1.1/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0         -O2 -Wall  -mtune=generic -c stri_pad.cpp -o stri_pad.o
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `C:/Users/Natusha/Google Drive (natusha.alirr@gmail.com)/R/Rtools/mingw_64/bin/g++  -std=gnu++11 -I"C:/Users/Natusha/GOOGLE~2.COM/R/R-36~1.1/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0         -O2 -Wall  -mtune=generic -c stri_pad.cpp -o stri_pad.o'
make: *** [C:/Users/Natusha/GOOGLE~2.COM/R/R-36~1.1/etc/x64/Makeconf:215: stri_pad.o] Error 1
ERROR: compilation failed for package 'stringi'
* removing 'C:/Users/Natusha/Google Drive (natusha.alirr@gmail.com)/R/R-3.6.1/library/stringi'
* restoring previous 'C:/Users/Natusha/Google Drive (natusha.alirr@gmail.com)/R/R-3.6.1/library/stringi'
Warning in install.packages :
  installation of package ‘stringi’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Natusha\AppData\Local\Temp\RtmpuSXwbu\downloaded_packages’

What can I do? I tried downloading and pasting the folder directly on the library, but it did not work. I also tried

install.packages("stringi", type = "source")

options(install.packages.check.source = "no")

But the same message appear. Can someone help me?

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 3
    Spaces in directory paths on Windows can break many things, read https://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-install-R-for-Windows_003f. As a workaround, see my answer https://stackoverflow.com/a/59814948/3358272 to install it into a different location (without spaces in it) and then move into your normal R path. (Or change your windows user home directory to be something a little more sane than one that contains spaces, parens, and `@` ... which is a first for me :-) – r2evans Sep 28 '20 at 18:02
  • This is likely to be a problem for any `"source"`-type package (that requires compiling). See my answer [here](https://stackoverflow.com/a/64096568/3358272) for installing `"binary"` packages. – r2evans Sep 28 '20 at 18:03
  • Even changing the directory, the same problem appeares. This directory had the @, because is the backup folder from Google Drive, so in all my computers I'm always working with the same data on R. – Natusha Cacau Pinheiro Costa Oct 01 '20 at 17:48

1 Answers1

6

If you are on Windows, stick to binary packages if the source install fails (and you do not want the source package).

install.packages ("stringi", type = "win.binary")

smichal
  • 141
  • 4