在ubuntu 16.04上安装rgdal时出现问题

在ubuntu 16.04上安装rgdal时出现问题,r,ubuntu,ubuntu-16.04,rgdal,R,Ubuntu,Ubuntu 16.04,Rgdal,我一直试图在R3.4.2(RStudio1.1.383)和Ubuntu16.04上安装rgdal,但最后总是出现问题 我遵循了许多建议,比如手动安装libproj dev之类的依赖项,或者我最后一次尝试使用 我能够安装gdal 1.11.3,但这还不够 这是我写入时的输出 install.packages('rgdal', type = "source", configure.args=c('--with-proj-include=/usr/local/include','--with-

我一直试图在R3.4.2(RStudio1.1.383)和Ubuntu16.04上安装rgdal,但最后总是出现问题

我遵循了许多建议,比如手动安装libproj dev之类的依赖项,或者我最后一次尝试使用

我能够安装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
错误“proj_api.h not found”也出现在同一个版本中,但给出的解决方案在我的案例中不起作用,而它似乎对许多其他用户起作用


谢谢你帮我解决这个问题。

我终于找到了解决办法

我遵循了这个答案

奇迹密码是

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

谢谢你的帮助

我终于找到了解决办法

我遵循了这个答案

奇迹密码是

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

感谢您的帮助

请确保,您知道要从终端安装
sudo apt install libproj dev
,而不是在R会话中?是的。我已经用终端运行了几乎所有的程序。
sudo-apt-get-install-libgdal-dev
?是的,它给我的错误消息与我的帖子中相同(“proj_-api.h-not-found”)。只是为了确定,你知道
sudo-apt-install-libproj-dev
是从终端安装的,而不是在R会话中?是的。我已经用这个终端运行了几乎所有的东西。而且
sudo apt get install libgdal dev
?是的,它给我的错误消息(“proj_api.h not found”)和我的帖子中的一样。