【问题标题】:trouble in installing rgdal on ubuntu 16.04在 ubuntu 16.04 上安装 rgdal 的麻烦
【发布时间】:2018-04-18 21:05:38
【问题描述】:

我一直在尝试在 R 3.4.2 (RStudio 1.1.383) 和 ubuntu 16.04 上安装 rgdal,但它总是以一个问题结束。

我遵循了许多建议,例如手动安装 libproj-dev 等依赖项,或者我上次尝试使用 homebrew

我能够安装 gdal 1.11.3,但这还不够。

这是我写的时候的输出

    install.packages('rgdal', type = "source", configure.args=c('--with-proj-include=/usr/local/include','--with-proj-lib=/usr/local/lib'))

Installing package into ‘/home/tupac/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
essai de l'URL 'https://cran.rstudio.com/src/contrib/rgdal_1.2-15.tar.gz'
Content type 'application/x-gzip' length 1648779 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ correctement décompressé et sommes MD5 vérifiées
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 1.2-15
checking for /usr/bin/svnversion... no
configure: svn revision: 691
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.11.3
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/1.11/pcs.csv readable... yes
configure: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/local/include 
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 ‘/home/tupac/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

在同一个post 中也发现了错误“proj_api.h not found”,但给出的解决方案在我的情况下不起作用,而它似乎适用于许多其他用户。

感谢您帮助我解决此问题。

【问题讨论】:

  • 只是为了确定,你知道sudo apt install libproj-dev是从终端安装的,而不是在R会话中?
  • 确实如此。我已经用终端运行了几乎所有东西。
  • 还有sudo apt-get install libgdal-dev ?
  • 是的,它给了我与我的帖子相同的错误消息(“proj_api.h not found”)。

标签: r ubuntu ubuntu-16.04 rgdal


【解决方案1】:

我终于找到了解决办法。

我关注了这个post的回答

奇迹密码是

sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin python-gdal python3-gdal libgdal1-dev

感谢您的帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-16
    • 2017-11-07
    • 1970-01-01
    • 1970-01-01
    • 2019-10-20
    • 1970-01-01
    • 2016-03-10
    • 2021-02-25
    相关资源
    最近更新 更多