RGDAL won't install

别说谁变了你拦得住时间么 提交于 2020-01-02 01:43:08

问题


I can't get RGDAL to install in R. I'm using Ubuntu 12.04.

configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

I found some solutions which said to do this:

sudo apt-get install aptitude
sudo aptitude install libgdal-dev 
sudo aptitude install libproj-dev

I follow these through, accepting 'yes' when prompted, but afterwards the same original error. It doesn't resolve it. I wonder whether I should be downgrading something perhaps?

Thanks, James.


回答1:


First check that everything is up to date with:

sudo apt-get update

On a slight tangent - i usually also install and a few others (needed for libraries like tidyverse):

sudo apt-get install -y libxml2-dev libcurl4-openssl-dev libssl-dev

Then install Rgdal and proj.4 (you may have to click yes a few times):

sudo apt-get install libgdal-dev 
sudo apt-get install libproj-dev


来源:https://stackoverflow.com/questions/31342575/rgdal-wont-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!