Failures in installing igraph on Google Colab for R

I tried several times in installing igraph on Google Colab for R in an ipynb notebook, but keep receiving warning:

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Warning message in install.packages(c(“igraph”)):
“installation of package ‘igraph’ had non-zero exit status”
Error in library(igraph): there is no package called ‘igraph’
Traceback:

  1. library(igraph)

Most other packages for R could be installed properly, but igraph which I am now in desperate need could not be installed. I also tried installing with Devtools from Github, and using Python packages, and all of these methods are not successful.

I am new to R, so I am grateful if anyone help me with this little bug. Thank you!

You need to install the prerequisites first, as described in the installation instructions:

Run this in Colab before the installation:

system('apt-get install libglpk-dev libgmp-dev libxml2-dev', intern=T)
1 Like

Thanks a lot! It works~

1 Like