简体   繁体   中英

R package igraph cant install, needed for rstanarm. No gfortran found?

Rstanarm seems to install normally. But attempting to load:

> library(rstanarm)
Error: package or namespace load failed for ‘rstanarm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘igraph’
In addition: Warning message:
package ‘rstanarm’ was built under R version 4.0.5 

Attempting to install igraph, I get a very long text ending with the following:

compilation terminated.
make: *** [C:/PROGRA~1/R/R-40~1.4/etc/i386/Makeconf:222: core/community/optimal_modularity.o] Error 1
ERROR: compilation failed for package 'igraph'
* removing 'C:/Users/siegl/OneDrive/Documents/R/win-library/4.0/igraph'
Warning in install.packages :
  installation of package ‘igraph’ had non-zero exit status

Older answers imply I need to install gfortran, but even after following the instructions here: https://masuday.github.io/fortran_tutorial/install_gfortran_windows.html and installing gfortran, that did not work either.

What should I do? Is gfortran off the directory path maybe? Typing gfortran into msys2 gets a fatal error that there are no input files, even though pacman -Su gcc-fortran installed it correctly

The correct answer was that I needed to update R to 4.2, as I have neglected to update for too long. Thank you Szabolcs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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