【发布时间】:2017-03-22 17:59:31
【问题描述】:
尝试在 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 库或为您的操作系统调用的任何库。也许this post 会有所帮助。
-
谢谢!仅供参考,在这里这样做:cran.r-project.org/bin/macosx/tools
标签: r macos forecasting install.packages