2

I am trying to install the R package mapview on Ubuntu but I get the error:

ERROR: lazy loading failed for package ‘mapview’

I have tried installing both the CRAN version of mapview and the development version, ie, by:

remotes::install_github("r-spatial/mapview")

In either case, I always get variations of the same message:

> install.packages("mapview")
Installing package into ‘/home/<my user name>/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/mapview_2.10.0.tar.gz'
Content type 'application/x-gzip' length 1683417 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘mapview’ ...
** package ‘mapview’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
corrupted size vs. prev_size
Aborted (core dumped)
ERROR: lazy loading failed for package ‘mapview’
* removing ‘/home/<my username>/R/x86_64-pc-linux-gnu-library/4.1/mapview’
Warning in install.packages :
  installation of package ‘mapview’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpKtQmnI/downloaded_packages’

If I try the development version, it asks me to update other packages (eg, raster) but then the same problem occurs for that package.

Other postings have suggested that the error can be fixed by restarting the R session. I have not found this to be the case.

My Session Info is:

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_NZ.UTF-8       LC_NUMERIC=C               LC_TIME=en_NZ.UTF-8       
 [4] LC_COLLATE=en_NZ.UTF-8     LC_MONETARY=en_NZ.UTF-8    LC_MESSAGES=en_NZ.UTF-8   
 [7] LC_PAPER=en_NZ.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13   magrittr_2.0.1    usethis_2.1.3     devtools_2.4.3    pkgload_1.2.4    
 [6] R6_2.5.1          rlang_0.4.12      fastmap_1.1.0     tools_4.1.2       pkgbuild_1.2.1   
[11] sessioninfo_1.2.2 cli_3.1.0         withr_2.4.3       ellipsis_0.3.2    remotes_2.4.2    
[16] rprojroot_2.0.2   lifecycle_1.0.1   crayon_1.4.2      processx_3.5.2    purrr_0.3.4      
[21] callr_3.7.0       fs_1.5.1          ps_1.6.0          testthat_3.1.1    curl_4.3.2       
[26] memoise_2.0.1     glue_1.6.0        cachem_1.0.6      compiler_4.1.2    desc_1.4.0       
[31] prettyunits_1.1.1
land-ahoy
  • 71
  • 1
  • 4
  • I just checked and also had problems installing `mapview` as well as other packages requiring GDAL etc (including raster and leafem). `sudo apt autoclean` and `sudo apt autoremove` did clean/remove some older gdal versions from my Ubuntu 20.04 and I can now install all packages without problem. HTH – TimSalabim Jan 08 '22 at 10:25

1 Answers1

0

I can't reproduce your error, but you could solve it by installing R with Conda and then the package with https://anaconda.org/conda-forge/r-mapview

fergusrg
  • 59
  • 6
  • Appreciate the idea. However, I use the RStudio IDE and it looks like there are some recent issues with getting it to work within a conda environment and a general lack of support of RStudio from Anaconda. – land-ahoy Jan 08 '22 at 02:14