r-安装rgdal MacOS时出错-仍然



有很多关于安装rgdal包问题的帖子。我已经经历了很多,尝试了许多推荐的解决方案,但仍然存在问题。我在OS10.15.7(Catalina(下的Mac上使用R4.0.3。我使用MacPorts进行软件包管理。我包括了我使用的R命令和下面的结果,但首先要强调的似乎是问题:

  1. 错误";未能找到"sversion"。我不理解这一点,因为输出中的前一行读作";正在检查/usr/bin/snversion。。。是";并使用终端";该sversion";收益率"/usr/bin/snversion";。关于命令行工具的后续消息已经在其他地方讨论过了,我遵循了删除command_tools目录并安装独立版本的建议;这没什么区别。

  2. gdal配置?它存在并且是可执行的,但是该文本";cat:ist/SVN_VERSION:没有这样的文件或目录";出现在系统回答"否"之前;是";检查gdal配置的可用性。在网上寻找那条特定的信息没有任何帮助(至少对我来说(。

  3. pkg配置项目?我使用MacPorts 安装了proj

    %sudo端口安装项目

密码:--->清洁项目--->正在扫描二进制文件以查找链接错误--->未找到损坏的文件
--->未找到损坏的端口。

但系统似乎在寻找proj.pc。那是什么?

  1. pkg配置:未找到命令,但找到

    %配置的软件包

/opt/local/bin/pkg-config

我已经玩了好几天了,非常感谢你的帮助,即使它只是指向我可能错过的前一篇文章。

从R内部,我发出命令

install.packages("rgdal", type="source", repos="http://R-Forge.R-project.org", configure.args=c('--with-gdal-config=/opt/local/bin/gdal-config'))

结果是:

Installing package into ‘/Users/blesht/Library/R/4.0/library’
(as ‘lib’ is unspecified)
trying URL 'http://R-Forge.R-project.org/src/contrib/rgdal_1.5-19.tar.gz'
Content type 'application/x-gzip' length 4375551 bytes (4.2 MB)
==================================================
downloaded 4.2 MB
* installing *source* package ‘rgdal’ ...
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang -mmacosx-version-min=10.13
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++11
configure: CFLAGS: -Wall -g -O2
configure: CPPFLAGS: -I/usr/local/include
configure: CXXFLAGS: -Wall -g -O2
configure: LDFLAGS: -L/usr/local/lib
configure: LDFLAGS: -L/usr/local/lib
configure: CXX11 is: clang++ -mmacosx-version-min=10.13, CXX11STD is: -std=gnu++11
configure: CXX is: clang++ -mmacosx-version-min=10.13 -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.5-19
checking for /usr/bin/svnversion... yes
svnversion: error: Failed to locate 'svnversion'.
svnversion: error: The subversion command line tools are no longer provided by Xcode.
configure: svn revision: 
configure: gdal-config set to /opt/local/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... cat: inst/SVN_VERSION: No such file or directory
yes
configure: GDAL: 3.2.0
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking GDAL: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL: /opt/local/share/gdal/stateplane.csv readable... yes
configure: pkg-config proj not available
set PKG_CONFIG_PATH to the directory containing proj.pc
configure: PROJ version not determined using pkg-config proj
configure: PROJ CPP flags:  -I/opt/local/include
configure: PROJ LIBS:  -lproj
checking PROJ header API:... yes
configure: API to be used as yet undetermined, searching ...
./configure: line 2509: pkg-config: command not found
configure: error: API to be used not found
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Users/blesht/Library/R/4.0/library/rgdal’
The downloaded source packages are in
‘/private/var/folders/l1/qvc9dqvn42b2y88cbyq_m3yw0000gn/T/RtmpsbrzxM/downloaded_packages’
Warning message:
In install.packages("rgdal", type = "source", repos = "http://R-Forge.R-project.org",  :
installation of package ‘rgdal’ had non-zero exit status

在经历了很多麻烦之后,我能够安装rgdal包。

Mac OS X 10.15.7(Catalina(

R版本4.1.1(2021-08-10(

RStudio 1.4.1717版

  1. 从RStudio内部使用"工具/安装包"菜单,选择CRAN存储库,然后安装";sf";包装

  2. 然后从CRAN储存库进行同样的操作;rgdal";

安装包的这些步骤:

sf 1.0-2

rgdal 1.5-23

相关内容

最新更新