2

我正在尝试在 Ubuntu 上安装 R 包 mapview,但出现错误:

ERROR: lazy loading failed for package ‘mapview’

我已经尝试安装 CRAN 版本的 mapview 和开发版本,即通过:

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

无论哪种情况,我总是会收到相同消息的变体:

> 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’

如果我尝试开发版本,它会要求我更新其他包(例如,光栅),但该包会出现同样的问题。

其他帖子建议可以通过重新启动 R 会话来修复该错误。我没有发现这种情况。

我的会话信息是:

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
4

1 回答 1

0

我无法重现您的错误,但您可以通过使用 Conda 安装 R 然后使用https://anaconda.org/conda-forge/r-mapview安装包来解决它

于 2022-01-07T12:55:19.557 回答