'Warning in install.packages : installation of package ‘igraph’ had non-zero exit status

I want to install phyloseq from BioConductor. When I do so, and try to load it, I get an error about igraph (even though I set dependencies to be TRUE). I have tried installing igraph independently, and that is also not working, with non-zero exit status.

I am using RStudio


R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Does anyone have any advice? Errors are pasted below.

Thank you for your help!

Here is my command:

install.packages("phyloseq", dependencies = TRUE)

Here is the warning:

Warning in install.packages :

dependency ‘igraph’ is not available


Here I try to load the package I want: library("phyloseq")

Here is the warning: Error:

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

Here I try to install igraph directly: install.packages("igraph", dependencies = TRUE)

Here is the compilation failure:

ERROR: compilation failed for package ‘graph’ Warning in install.packages : installation of package ‘igraph’ had non-zero exit status



Solution 1:[1]

Open a new terminal and type:

xcode-select --install

Solution 2:[2]

I went to the developer page of igraph and downloaded the package into my r library folder. For whatever reason, r does not pull igraph into the library folder when called on the command line so you have to do it manually. Shout out to my prof who showed me how to do this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 K Grover