mapview icon indicating copy to clipboard operation
mapview copied to clipboard

mapview/mapedit installation on Google colab

Open yoshida-gisc opened this issue 3 years ago • 5 comments

We would like to run a spatial analysis in Google Colab using the mapview/mapedit package. However, when trying to install the mapview/mapedit package via the install.package() function, it does not work, even following the manner below:

https://colab.to/r

system("apt-get -y update")
system("apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev")
install.packages("mapview")
library("mapview")

This codes are fine for the sf package following the issue (https://github.com/r-spatial/sf/issues/1946). However, it does not seem to be enough for the mapview/mapedit package.

Thanks in advances, Takahiro

yoshida-gisc avatar Jan 01 '23 14:01 yoshida-gisc

Please give the entire output you see after giving the install.packages("mapview") command.

edzer avatar Jan 01 '23 16:01 edzer

We run the code below in Google Colab.

system("apt-get -y update")
system("apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev")
install.packages("mapview")

Then, we faced the error message below. Note that we also faced time-out for running it (about 15 minutes).

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘sfheaders’, ‘promises’, ‘geojsonsf’, ‘httpuv’, ‘classInt’, 
‘s2’, ‘units’, ‘htmlwidgets’, ‘leafem’, ‘leaflet’, ‘leafpop’, ‘raster’, ‘satellite’, ‘servr’, ‘sf’

Warning message in install.packages("mapview"):
“installation of package ‘s2’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘geojsonsf’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘httpuv’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘leaflet’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘satellite’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘sf’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘leafem’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘leafpop’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘servr’ had non-zero exit status”
Warning message in install.packages("mapview"):
“installation of package ‘mapview’ had non-zero exit status”

We may need to install some system-dependecies. But, we cannot identify it ....

yoshida-gisc avatar Jan 01 '23 17:01 yoshida-gisc

On a fresh colab notebook I can install sf, then mapview, but when loading mapview I get the following error: Screenshot from 2023-01-01 20-48-33

htmltools is required by IRkernel, which essentially runs your colab, so cannot be unloaded; re-installing htmltools is possible but we can't load it because of this dependency. I don't see who needs htmltools >= 0.5.4, mapview doesn't say so in its DESCRIPTION.

edzer avatar Jan 01 '23 19:01 edzer

I appreciate your prompt check! I faced the same error message. A feasible solution may be to wait for IRkernel to require htmltools 0.5.4 ...?

yoshida-gisc avatar Jan 01 '23 20:01 yoshida-gisc

When installing the mapedit package, the same error message occurs. image

yoshida-gisc avatar Jan 01 '23 21:01 yoshida-gisc