首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gcc-8:找不到命令(在安装randomForest时)

gcc-8:找不到命令(在安装randomForest时)
EN

Stack Overflow用户
提问于 2022-07-23 00:04:32
回答 1查看 45关注 0票数 1

我试图在R3.6.3上安装"randomForest“,如下所示:

代码语言:javascript
复制
urlPackage <- "https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz"
install.packages(urlPackage, repos=NULL, type="source")

(install.packages( 'randomForest‘)抛出错误:包’randomForest‘不可用(用于RVersion3.6.3)

然而,上面的行给出了以下错误:

代码语言:javascript
复制
    trying URL 'https://cran.r-project.org/src/contrib/Archive/randomForest/randomForest_4.6-14.tar.gz'
Content type 'application/x-gzip' length 80074 bytes (78 KB)
==================================================
downloaded 78 KB

* installing *source* package ‘randomForest’ ...
** package ‘randomForest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -mtune=native -g -O2 -Wall -pedantic -Wconversion -c classTree.c -o classTree.o
/bin/sh: gcc-8: command not found
make: *** [classTree.o] Error 127
ERROR: compilation failed for package ‘randomForest’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/randomForest’
Warning in install.packages :
  installation of package ‘/var/folders/66/3s4r17rx7ln0b1p8tyrmws780000gn/T//RtmpDOHynP/downloaded_packages/randomForest_4.6-14.tar.gz’ had non-zero exit status

有人知道怎么解决这个问题吗?我在macOS Catalina (Ver10.15.7)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-23 00:14:42

您应该安装gcc8工具:

代码语言:javascript
复制
sudo port install gcc8

相关链接

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73087132

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档