由于 rtools40 安装 tidyverse 失败:没有这样的文件或目录

问题描述

我使用的是 Windows。

我刚刚将 R 更新到了 4.0.4 版。我尝试安装 tidyverse。

提交后

install.packages("tidyverse")

下载了很多包。在此过程中,这出现在我的控制台中

  There is a binary version available but the source version is later:
     binary source needs_compilation
utf8  1.1.4  1.2.1              TRUE

然后,在这个过程的后期: 安装源包‘utf8’

尝试 URL 'https://cran.rstudio.com/src/contrib/utf8_1.2.1.tar.gz' 内容类型 'application/x-gzip' 长度 239463 字节 (233 KB) 已下载 233 KB

* installing *source* package 'utf8' ...
** package 'utf8' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
"c:/rtools40/mingw32/bin/"gcc  -I"C:/PROGRA~1/R/R-4.0.4/include" -DNDEBUG       -Iutf8lite/src   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c as_utf8.c -o as_utf8.o
sh: c:/rtools40/mingw32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-4.0.4/etc/i386/Makeconf:222: as_utf8.o] Error 127
ERROR: compilation Failed for package 'utf8'
* removing 'C:/Users/Peter/Documents/R/win-library/4.0/utf8'
Warning in install.packages :
  installation of package ‘utf8’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Peter\AppData\Local\Temp\Rtmpempsyo\downloaded_packages’

我对此知之甚少,除了没有安装该软件包并且没有它就无法运行 tidyverse。即

library(tidyverse)

结果

Error: package or namespace load Failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]],c(lib.loc,.libPaths()),versionCheck = vI[[j]]):
 there is no package called ‘utf8’

我该如何解决这个问题?

解决方法

我用谷歌搜索,发现了这个:

https://cran.r-project.org/bin/windows/Rtools/

哪个有效。