简体   繁体   English

在 Ubuntu 20.04 上安装 R package 地图视图

[英]Installing the R package mapview on Ubuntu 20.04

I am trying to install the R package mapview on Ubuntu but I get the error:我正在尝试在 Ubuntu 上安装 R package mapview,但出现错误:

ERROR: lazy loading failed for package ‘mapview’

I have tried installing both the CRAN version of mapview and the development version, ie, by:我已经尝试安装 CRAN 版本的 mapview 和开发版本,即通过:

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.如果我尝试开发版本,它会要求我更新其他包(例如,光栅),但是 package 也会出现同样的问题。

Other postings have suggested that the error can be fixed by restarting the R session.其他帖子建议可以通过重新启动R session来修复错误。 I have not found this to be the case.我没有发现这种情况。

My Session Info is:我的 Session 信息是:

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

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我无法重现您的错误,但您可以通过安装 R 和 Conda 来解决它,然后安装 package 和https://-mapview.org/conda

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM