简体   繁体   English

在R版本3.3.2中安装'forecast'软件包时出错

[英]Errors installing 'forecast' package in R version 3.3.2

Trying to install 'forecast' package in R version 3.3.2 on MacOS Sierra as follows: 试图在MacOS Sierra上的R版本3.3.2中安装“预测”软件包,如下所示:

install.packages("forecast")

Getting a slew of errors I don't understand. 得到一些我不明白的错误。 First it downloads all dependency packages from http://cloud.r-project.org . 首先,它从http://cloud.r-project.org下载所有依赖包。 First error I get is this: 我得到的第一个错误是:

* installing *source* package ‘quadprog’ ...
** package ‘quadprog’ successfully unpacked and MD5 sums checked
** libs
gfortran -arch x86_64   -fPIC  -g -O2  -c aind.f -o aind.o
make: gfortran: No such file or directory
make: *** [aind.o] Error 1
ERROR: compilation failed for package ‘quadprog’
* removing ‘/Users/ekorne201/Library/R/3.3/library/quadprog’

It then moves on to: 然后继续:

* installing *source* package ‘fracdiff’ ...
** package ‘fracdiff’ successfully unpacked and MD5 sums checked

After which it says: 之后它说:

ld: warning: directory not found for option '-L/Users/Shared/Jenkins/workspace/External-R-3.3.2/vendor/build/lib'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/x86_64'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [fracdiff.so] Error 1
ERROR: compilation failed for package ‘fracdiff’
* removing ‘/Users/ekorne201/Library/R/3.3/library/fracdiff’

Goes through the same thing for 'lmtest' and 'RcppArmadillo', after which it ends with: 对'lmtest'和'RcppArmadillo'进行同样的操作,然后结束:

 ERROR: dependencies ‘tseries’, ‘fracdiff’, ‘lmtest’, ‘RcppArmadillo’ are not available for package ‘forecast’
    * removing ‘/Users/ekorne201/Library/R/3.3/library/forecast’

    The downloaded source packages are in
        ‘/private/var/folders/8p/54qnlb9x7bj8syz631_d58t92rmkyp/T/Rtmp246ipQ/downloaded_packages’
    Warning messages:
    1: In install.packages("forecast") :
      installation of package ‘quadprog’ had non-zero exit status
    2: In install.packages("forecast") :
      installation of package ‘fracdiff’ had non-zero exit status
    3: In install.packages("forecast") :
      installation of package ‘lmtest’ had non-zero exit status
    4: In install.packages("forecast") :
      installation of package ‘RcppArmadillo’ had non-zero exit status
    5: In install.packages("forecast") :
      installation of package ‘tseries’ had non-zero exit status
    6: In install.packages("forecast") :
      installation of package ‘forecast’ had non-zero exit status

Stuck on how to proceed and would appreciate the advice. 坚持如何继续并欣赏建议。

I got the same error. 我得到了同样的错误。 I solved it by installing the gfortran . 我通过安装gfortran解决了这个问题。 In macOS, I can do it such that 在macOS中,我可以这样做

brew install gcc 

and in R such that 在R这样

install.packages("forecast")

so 所以

> library(forecast); fit <- tbats(UScitiesD);
> fit
BATS(0.566, {0,2}, -, -)

Call: tbats(y = UScitiesD)

Parameters
  Lambda: 0.565592
  Alpha: 0.2166945
  MA coefficients: -0.130506 -0.511551

Seed States:
         [,1]
[1,] 90.10291
[2,]  0.00000
[3,]  0.00000

Sigma: 27.61468
AIC: 761.9238

As mentioned in comments, other method is to install it from here . 正如评论中所提到的,其他方法是从这里安装它。

Related 有关

  1. Does installing gfortran with homebrew and with an installer create a conflict? 使用自制软件和安装程序安装gfortran是否会产生冲突?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM