简体   繁体   English

在 macOS 上更新 gdal 后安装 R 包 sf 0.9.0 时出错

[英]Error installing R package sf 0.9.0 after updating gdal on macOS

I've had sf and rproj working on mac forever, and still working since upgrading to Catalina / R 3.6.2.我让sfrproj永远在 mac 上工作,自从升级到 Catalina / R 3.6.2 后仍在工作。

I tried to install the latest version of sf (0.9.0), both from CRAN and the dev version, and get errors both ways, configure: error: libproj not found in standard or given locations.我尝试从 CRAN 和开发版本安装最新版本的sf (0.9.0),但两种方式都出现错误, configure: error: libproj not found in standard or given locations.

I've gone through and removed every last trace of gdal and proj on my computer, uninstalled both, reinstalled, and still same issue.我已经检查并删除了计算机上 gdal 和 proj 的最后痕迹,卸载了两者,重新安装,但仍然是同样的问题。 And now, trying to install older versions of sf (0.8.1) that I know worked on my computer also fails.现在,尝试安装我知道在我的计算机上工作的旧版本sf (0.8.1) 也失败了。 Absolutely stumped here!完全被这里难住了!

GDAL 2.4.4, released 2020/01/08 GDAL 2.4.4,2020/01/08 发布

R v3.6.2 R v3.6.2

macOS 10.15.3 macOS 10.15.3

configure: CC: clang
configure: CXX: clang++ -std=gnu++11
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking GDAL version >= 2.0.1... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 2.4.4
checking proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj not found in standard or given locations.

for rgdal ...对于rgdal ...

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: clang
configure: CXX: clang++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... yes
configure: svn revision: 845
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.4
checking C++11 support for GDAL >= 2.3.0... yes
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: /usr/local/Cellar/gdal/2.4.4_2/share/gdal/pcs.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/usr/local/Cellar/gdal/2.4.4_2/include
configure: PROJ LIBS:  -lproj
checking PROJ header API:... proj_api.h
checking proj_api.h presence and usability... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rgdal

终于找到了几个小时的挖掘后的解决方案在这里,如果其他人遇到这个问题。

A solution that works for me.一个对我有用的解决方案。 I have posted it in: https://biostatsr.blogspot.com/2021/05/install-sf-from-github-source-in-macosx.html我已将其发布在: https : //biostatsr.blogspot.com/2021/05/install-sf-from-github-source-in-macosx.html

In terminal.在终端。 You must have MacBrew installed.您必须安装了 MacBrew。 If not, use:如果没有,请使用:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then然后

brew install proj

brew install gdal

brew install geos

sudo R

Then in R:然后在R中:

 library("devtools")

 install_github("r-spatial/sf", configure.args = "--with-proj-include=/usr/local/include --with-proj-lib=/usr/local/lib")

And...和...

packageVersion("sf")包版本(“SF”)

[1] '0.9.9' [1] '0.9.9'

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

相关问题 从 conda 安装 gdal 2.3 后,sf R 包“与 2.0.0 以下的 GDAL 版本不兼容” - sf R package "is not compatible with GDAL versions below 2.0.0" after installing gdal 2.3 from conda Macos下renv下R安装sf package - Installing sf package in R under renv on Macos 在 Centos 上安装 R &#39;sf&#39; 包 — gdal 共享库错误 - Install R 'sf' package on Centos — gdal shared library error MacOS M1:在 R 中安装 sf 时出现问题 - 错误:package 'classInt' 的编译失败; 错误:package 'units' 的配置失败 - MacOS M1: problems with installing sf in R - ERROR: compilation failed for package ‘classInt’; ERROR: configuration failed for package ‘units’ 在R中安装软件包“ sf”; 在macOS 10.13.2中错误:…anaconda3 / bin / x86_64-apple-darwin13.4.0-gfortran:没有这样的文件或目录 - Installing package “sf” in R; in macOS 10.13.2 error: …anaconda3/bin/x86_64-apple-darwin13.4.0-gfortran: No such file or directory 如何在 CentOS 6.8 安装 sf R 的包或 GDAL - How install sf R's package or GDAL at CentOS 6.8 由于“gdal”而无法安装“sf” - trouble installing "sf" due to "gdal" 无法在 R(大苏尔)中安装 package“sf” - Trouble installing package "sf" in R (Big Sur) 安装R包后出现系统错误 - System Error after installing R package 安装r包后出现rpy2错误 - rpy2 error after installing r package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM