【问题标题】:Problem with install.packages ("stringi") on RR上的install.packages(“stringi”)问题
【发布时间】:2021-01-14 08:02:48
【问题描述】:

在 Windows 10 上,RStudio。我试过使用命令 install.packages,但它会出现以下消息:

> 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’

我能做什么?我尝试将文件夹直接下载并粘贴到库上,但没有成功。 我也试过了

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

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

但同样的信息出现了。 有人可以帮我吗?

【问题讨论】:

  • Windows 目录路径中的空格会破坏很多东西,请阅读cran.r-project.org/bin/windows/base/…。作为一种解决方法,请参阅我的回答 stackoverflow.com/a/59814948/3358272 将其安装到不同的位置(其中没有空格),然后进入您的正常 R 路径。 (或者将您的 Windows 用户主目录更改为比包含空格、括号和 @ 的目录更健全一些...这对我来说是第一个 :-)
  • 这可能是任何"source"-type 包(需要编译)的问题。请参阅我的回答 here 以安装 "binary" 软件包。
  • 即使更改目录,也会出现同样的问题。这个目录有@,因为它是来自 Google Drive 的备份文件夹,所以在我所有的计算机上,我总是在 R 上处理相同的数据。

标签: r installation stringi


【解决方案1】:

如果您在 Windows 上,如果源安装失败(并且您不想要源包),请坚持使用 二进制 包。

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

【讨论】:

  • 谢谢!显然问题已解决,安装包成功!
  • @NatushaCacauPinheiroCosta 你应该接受他们的回答,因为这也对我有用。
猜你喜欢
  • 2018-12-29
  • 1970-01-01
  • 2014-06-14
  • 1970-01-01
  • 1970-01-01
  • 2013-10-15
  • 1970-01-01
  • 2016-09-29
  • 1970-01-01
相关资源
最近更新 更多