安装rgdal MacOS时出错-仍然
关于安装rgdal包的问题,已经有很多帖子。我经历了很多,尝试了很多推荐的解决方案,但仍然有问题。我在Mac上使用OS10.15.7(Catalina)下的R4.0.3。我使用MacPorts进行包管理。我包括了我使用的R命令和下面的结果,但将首先强调问题所在:安装rgdal MacOS时出错-仍然,r,macos,rgdal,R,Macos,Rgdal,关于安装rgdal包的问题,已经有很多帖子。我经历了很多,尝试了很多推荐的解决方案,但仍然有问题。我在Mac上使用OS10.15.7(Catalina)下的R4.0.3。我使用MacPorts进行包管理。我包括了我使用的R命令和下面的结果,但将首先强调问题所在: 错误“找不到“SvVersion”。我不理解这一点,因为输出中的前一行显示“正在检查/usr/bin/SvVersion…”。。。“是”,并使用终端“而svversion”产生“/usr/bin/svversion”。关于命令行工具的后
--->没有发现损坏的端口 但是系统似乎在寻找proj.pc。那是什么
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
将软件包安装到“/Users/blesht/Library/R/4.0/Library”中
(由于“lib”未指定)
正在尝试URL'http://R-Forge.R-project.org/src/contrib/rgdal_1.5-19.tar.gz'
内容类型“应用程序/x-gzip”长度4375551字节(4.2MB)
==================================================
下载4.2MB
*正在安装*source*包“rgdal”。。。
**使用分阶段安装
配置:R\u HOME:/Library/Frameworks/R.framework/Resources
配置:CC:clang-mmacosx版本最小值=10.13
配置:CXX:clang++-mmacosx版本min=10.13-std=gnu++11
配置:CFLAGS:-Wall-g-O2
配置:cppfagas:-I/usr/local/include
配置:CXXFLAGS:-Wall-g-O2
配置:LDFLAGS:-L/usr/local/lib
配置:LDFLAGS:-L/usr/local/lib
配置:CXX11为:clang++-mmacosx版本最小值=10.13,CXX11STD为:-std=gnu++11
配置:CXX是:clang++-mmacosx版本min=10.13-std=gnu++11
配置:C++11支持可用
配置:rgdal:1.5-19
正在检查/usr/bin/sversion…是
SvVersion:错误:未能找到“SvVersion”。
Sversion:错误:Xcode不再提供subversion命令行工具。
配置:svn修订版:
配置:gdal配置设置为/opt/local/bin/gdal配置
正在检查gdal配置是否存在…是
正在检查gdal配置可执行文件…是
正在检查gdal配置的可用性…cat:inst/SVN_版本:没有这样的文件或目录
对
配置:GDAL:3.2.0
正在检查GDAL版本>=1.11.4…是
正在检查GDAL版本=3.0…是
正在检查GDAL:仅使用--libs进行链接…是
正在检查GDAL:GDAL配置数据目录是否可读…是
正在检查GDAL:/opt/local/share/GDAL/stateplane.csv是否可读…是
配置:pkg配置项目不可用
将PKG_CONFIG_PATH设置为包含proj.pc的目录
配置:未使用pkg config PROJ确定项目版本
配置:项目CPP标志:-I/opt/local/include
配置:项目库:-lproj
正在检查项目标头API:…是
配置:尚未确定要使用的API,正在搜索。。。
./configure:line 2509:pkg config:command未找到
配置:错误:找不到要使用的API
错误:包“rgdal”的配置失败
*正在删除“/Users/blesht/Library/R/4.0/Library/rgdal”
下载的源程序包位于中
“/private/var/folders/l1/qvc9dqvn42b2y88cbyq_m3yw0000gn/T/RtmpsbrzxM/downloaded_packages”
警告信息:
在install.packages(“rgdal”,type=“source”,repos=”中http://R-Forge.R-project.org", :
包“rgdal”的安装具有非零退出状态
您是否尝试过安装type=“binary”
而不是从“源代码”安装?谢谢您的建议,Dave2e。这是我尝试的第一件事(似乎是几周前),但安装总是失败(尝试了很多次)超时失败。我不认为这是答案。如果超时失败,可以尝试其他存储库。我正在Rstudio下使用R(在我的Mac上),使用默认下载存储库,并且我能够下载二进制版本的“rgdal”"没有问题。另外,为了防止您看到的构建错误,我通常会避免使用源版本。祝您好运。再次感谢,Dave2e。恐怕没有什么乐趣。我尝试了几个存储库,但安装也以同样的方式失败。我还试着从RStudio安装,但没有成功,出现超时错误。我从未遇到过安装问题任何其他软件包。请问您是如何安装gdal和svn的?您使用的是哪种MacOS?升级到MacOS 11后,我最近不得不在基于intel的iMac上重新安装rgdal(R版本4.0.x,rgdal-1.5-18,没有svn).为了避免编译问题,我安装了二进制文件而不是源文件。它是一个大文件,因此如果您有防火墙,可能会出现问题??一个可能的选项,请转到,查找包(尝试此链接:)下载二进制版本的.tar文件,一旦它被解压/解压,您可以尝试将该文件夹放到您的R库文件夹中。
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