【问题标题】:Failed to install Swirl in R 3.2.1 on Mac OS10.9 - installation had non-zero status无法在 Mac OS10.9 上的 R 3.2.1 中安装 Swirl - 安装状态非零
【发布时间】:2018-01-23 05:19:50
【问题描述】:
> install.packages("swirl", depenedencies=TRUE)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘stringi’, ‘stringr’


  There are binary versions available but the source versions are
  later:
        binary source needs_compilation
stringi  1.1.1  1.1.5             FALSE
stringr  1.0.0  1.2.0             FALSE
swirl    2.4.2  2.4.3             FALSE

installing the source packages ‘stringi’, ‘stringr’, ‘swirl’

Error in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (depenedencies = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘stringi’ failed
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (depenedencies = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘stringr’ failed
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  unused argument (depenedencies = TRUE)
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package ‘swirl’ failed

当我不使用依赖参数时会发生这种情况

   > install.packages("swirl")
also installing the dependencies ‘stringi’, ‘stringr’


  There are binary versions available but the source versions are
  later:
        binary source needs_compilation
stringi  1.1.1  1.1.5             FALSE
stringr  1.0.0  1.2.0             FALSE
swirl    2.4.2  2.4.3             FALSE

installing the source packages ‘stringi’, ‘stringr’, ‘swirl’

trying URL 'http://cran.stat.auckland.ac.nz/src/contrib/stringi_1.1.5.tar.gz'
Content type 'application/x-gzip' length 3645872 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

trying URL 'http://cran.stat.auckland.ac.nz/src/contrib/stringr_1.2.0.tar.gz'
Content type 'application/x-gzip' length 94095 bytes (91 KB)
==================================================
downloaded 91 KB

trying URL 'http://cran.stat.auckland.ac.nz/src/contrib/swirl_2.4.3.tar.gz'
Content type 'application/x-gzip' length 108666 bytes (106 KB)
==================================================
downloaded 106 KB

* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /Library/Frameworks/R.framework/Resources
checking for R... /Library/Frameworks/R.framework/Resources/bin/R
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... yes
checking for cat... /bin/cat
checking for gcc... llvm-gcc-4.2 -arch x86_64 -std=gnu99
checking whether the C compiler works... no
configure: error: in `/private/var/folders/6h/2hpqtkx11xz8lytwg01m1tm40000gn/T/RtmpQqUeGZ/R.INSTALL3b727191707/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/stringi’
ERROR: dependency ‘stringi’ is not available for package ‘stringr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/stringr’
ERROR: dependency ‘stringr’ is not available for package ‘swirl’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/swirl’

The downloaded source packages are in
    ‘/private/var/folders/6h/2hpqtkx11xz8lytwg01m1tm40000gn/T/RtmpGnEGTh/downloaded_packages’
Warning messages:
1: In install.packages("swirl") :
  installation of package ‘stringi’ had non-zero exit status
2: In install.packages("swirl") :
  installation of package ‘stringr’ had non-zero exit status
3: In install.packages("swirl") :
  installation of package ‘swirl’ had non-zero exit status
>  

我是编程新手,还不确定如何阅读。当 R 给出同样的问题时,人们使用了几个命令用于其他包,我尝试了它们,但什么也没发生,所以我想我会在不知道自己在做什么的情况下停止做任何事情。

【问题讨论】:

  • 需要更多细节 - 它要求什么?截图/复制粘贴?

标签: r package status failed-installation swirl


【解决方案1】:

先试试这个:

install.packages("swirl", dependencies=TRUE)

如果失败,试试这个:

install.packages("stringr", dependencies=TRUE)
install.packages("stringi", dependencies=TRUE)
install.packages("swirl", dependencies=TRUE)

Swirl 需要这些软件包,如果尚未安装,请使用 dependencies=TRUE 强制它们同时安装,如果没有,请自行预安装并查看 swirl 是否有效。

【讨论】:

  • 尝试了所有方法,发出相同的警告消息:在 install.packages("stringi", dependencies = TRUE) : 安装包“stringi”的退出状态非零
猜你喜欢
  • 1970-01-01
  • 2016-05-18
  • 1970-01-01
  • 2017-01-09
  • 2016-11-25
  • 1970-01-01
  • 1970-01-01
  • 2020-04-15
  • 1970-01-01
相关资源
最近更新 更多