sf 和 rgdal 在 Mac OS Big Sur 上不起作用,如何解决?- 关闭 [英] sf and rgdal are not working on Mac OS Big Sur, how to fix? --Closed

查看:119
本文介绍了sf 和 rgdal 在 Mac OS Big Sur 上不起作用,如何解决?- 关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 library(sf)

错误:dyn.load(file, DLLpath = DLLpath, ...) 中sf"的包或命名空间加载失败:无法加载共享对象/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so":dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so, 6): 库未加载:/usr/lib/libpq.5.dylib引用自:/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so原因:找不到图片

Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so': dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so, 6): Library not loaded: /usr/lib/libpq.5.dylib Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf/libs/sf.so Reason: image not found

 library(rgdal)

错误:get(method,envir = home) 中rgdal"的包或命名空间加载失败:延迟加载数据库 '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/R/rgdal.rdb' 已损坏此外: 警告消息:1:在 .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], :重新开始中断的承诺评估2:在 get(method, envir = home) 中:重新开始中断的承诺评估3:在 get(method,envir = home) 中:R_decompress1 中的内部错误 -3

Error: package or namespace load failed for ‘rgdal’ in get(method, envir = home): lazy-load database '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgdal/R/rgdal.rdb' is corrupt In addition: Warning messages: 1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], : restarting interrupted promise evaluation 2: In get(method, envir = home) : restarting interrupted promise evaluation 3: In get(method, envir = home) : internal error -3 in R_decompress1

----问题已关闭----

----Issue closed----

CRAN 库已更新为与删除一些系统库的 Big Sur 兼容,因此只需从 CRAN 重新安装 rgdal 和 sf(感谢 Jeroen).为确保您获得最新版本,请使用

CRAN libraries have been updated to be compatible with Big Sur which removed some system libraries, so just re-install rgdal and sf from CRAN (thanks to Jeroen). To make sure you get the latest versions use

install.packages(c("rgdal","sf"), "https://mac.R-project.org")

ref: https://stat.ethz.ch/pipermail/r-sig-mac/2020-November/013783.html

推荐答案

问题是 R 包依赖于 Apple 从 macOS 11 中删除的 PostgreSQL 库.您可以修复"暂时通过手动安装所有必需的组件(brew install gdal 应该这样做,假设您使用 Homebrew),然后从源代码重新安装 R 包.这很麻烦,因为它会将多个 MB 的不必要的开发包下载到您的 Mac,但它可以工作.我希望包维护者尽快将缺失的库直接包含到 sfrgdal 的分发中.

The problem is that the R packages rely on the PostgreSQL library that Apple has removed from macOS 11. You can "fix" it for the time being by installing all the required components manually (brew install gdal should do it assuming you use Homebrew) and then re-installing the R packages from source. It's messy, since it will download multiple MBs of unnecessary development packages to your Mac, but it works. I hope that the package maintainers will soon include the missing libraries into the distribution of sf and rgdal directly.

这篇关于sf 和 rgdal 在 Mac OS Big Sur 上不起作用,如何解决?- 关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆