在 ubuntu 16.04 上安装 rgdal 的问题 [英] trouble in installing rgdal on ubuntu 16.04

查看:34
本文介绍了在 ubuntu 16.04 上安装 rgdal 的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have been trying to install rgdal on R 3.4.2 (RStudio 1.1.383) and ubuntu 16.04 but it always end with a problem.

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

I have followed many recommendations like manually installing the dependencies like libproj-dev or my last try by using homebrew.

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

I was able to install gdal 1.11.3 but it's not sufficient.

这是我写的时候的输出

    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

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

The error "proj_api.h not found" has also been found in the same post but the solution given does not work in my case while it seems to work for many other users.

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

thank you for helping me in fixing this problem.

推荐答案

我终于找到了解决方案.

I have finally been able to find a solution.

我按照这个帖子的答案

奇迹代码是

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

感谢您的帮助

这篇关于在 ubuntu 16.04 上安装 rgdal 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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