簡體   English   中英

在R版本3.3.2中安裝'forecast'軟件包時出錯

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

試圖在MacOS Sierra上的R版本3.3.2中安裝“預測”軟件包,如下所示:

install.packages("forecast")

得到一些我不明白的錯誤。 首先,它從http://cloud.r-project.org下載所有依賴包。 我得到的第一個錯誤是:

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

然后繼續:

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

之后它說:

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’

對'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

堅持如何繼續並欣賞建議。

我得到了同樣的錯誤。 我通過安裝gfortran解決了這個問題。 在macOS中,我可以這樣做

brew install gcc 

在R這樣

install.packages("forecast")

所以

> 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

正如評論中所提到的,其他方法是從這里安裝它。

有關

  1. 使用自制軟件和安裝程序安裝gfortran是否會產生沖突?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM