Aqu*_*irl 57 linux installation r gdal
请指出我遗漏的一点:
openSUSE 11.3
anisha@linux-y3pi:~/Desktop/R> sudo R CMD INSTALL rgdal_0.7-12.tar.gz
root's password:
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: gdal-config: gdal-config
checking gdal-config usability... ./configure: line 1353: gdal-config: command not found
no
Error: gdal-config not found
The gdal-config script distributed with GDAL could not be found.
If you have not installed the GDAL libraries, you can
download the source from http://www.gdal.org/
If you have installed the GDAL libraries, then make sure that
gdal-config is in your path. Try typing gdal-config at a
shell prompt and see if it runs. If not, use:
--configure-args='--with-gdal-config=/usr/local/bin/gdal-config'
with appropriate values for your installation.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/lib64/R/library/rgdal’
Run Code Online (Sandbox Code Playgroud)
anisha@linux-y3pi:~/Desktop/R> whereis gdal-config
gdal-config: /usr/local/bin/gdal-config
anisha@linux-y3pi:~/Desktop/R> gdal-config
Usage: gdal-config [OPTIONS]
Options:
[--prefix[=DIR]]
[--libs]
[--dep-libs]
[--cflags]
[--datadir]
[--version]
[--ogr-enabled]
[--formats]
anisha@linux-y3pi:~/Desktop/R>
Run Code Online (Sandbox Code Playgroud)
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
>
Run Code Online (Sandbox Code Playgroud)
编辑:
anisha@linux-y3pi:~/Desktop/R> gdal-config --version
1.9.0
anisha@linux-y3pi:~/Desktop/R> proj
Rel. 4.8.0, 6 March 2012
usage: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ]
Run Code Online (Sandbox Code Playgroud)
linux-y3pi:~ # $PATH
bash: /home/anisha/qtsdk-2010.05/qt/bin/:/home/anisha/qtsdk-2010.05/bin:/home/anisha/qtsdk-2010.05/qt/bin:/home/anisha/qtsdk-2010.05/qt/bin/:/home/anisha/qtsdk-2010.05/bin:/usr/lib64/mpi/gcc/openmpi/bin:/home/anisha/bin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games: No such file or directory
Run Code Online (Sandbox Code Playgroud)
Dir*_*tel 76
你需要的-dev包报头和共享库链接,开发除了正常的包部署.就发行版而言,有两种不同的用例.
在我的发行:
edd@max:/tmp$ dpkg -l | grep gdal | cut -c-72
ii libgdal1-1.7.0 1.7.3-6ubuntu3
ii libgdal1-dev 1.7.3-6ubuntu3
edd@max:/tmp$
Run Code Online (Sandbox Code Playgroud)
R CMD INSTALL rgdal_0.7-8.tar.gz考虑到CRAN的所有构建时间检查,并且可以正常使用CRAN包.
2016年末更新: 正如@JoshO'Brien在评论中指出的那样
次要更新:在2016年,运行Ubuntu 14.04.2,
libgdal1h似乎已经取代libgdal1(虽然libgdal1-dev仍然需要).至少我试图这样做时会出现错误apt-get install libgdal1
对于Ubuntu 16.04,相应的行将是
sudo apt-get install libgdal1i
上游库的这种重命名很常见; 诸如apt-cache search libgdal可以帮助找到当前包名称的东西.在重要的关键是,虽然在"抽象"的开发包libgdal-dev是建立,因为它拉"具体的"当前运行包所有需要:(这里libgdal1i在通过依赖).
Gay*_*hne 49
在Ubuntu 18.04中
我修好了sudo apt install libgdal-dev
希望有人觉得这很有用.上面的一些答案似乎已经过时而且冗长.
在早期版本(有apt-get)
sudo apt-get install libgdal-dev
Eri*_*ick 34
您可以使用apt-file包来查找包含您要查找的丢失文件的包.
首先使用命令Update apt-file安装apt-file使用命令现在可以使用apt-file查找丢失的文件.apt-get install apt-file apt-file update apt-file search gdal-config
对于我的情况,我从svn配置grass-7.1时遇到了同样的错误.如下所示:
$ ./configure
...more...
checking whether to use GDAL... yes
checking for gdal-config... /usr/bin/gdal-config
...more....
./configure: 1: ./configure: /usr/bin/gdal-config: not found
./configure: 6093: test: =: unexpected operator
configure: error: *** Unable to locate GDAL library.
Run Code Online (Sandbox Code Playgroud)
但是,在使用apt-file查找gdal-config文件后,如下所示,我能够在安装包libgdal1-dev后解决错误
$ apt-file search gdal-config
Run Code Online (Sandbox Code Playgroud)
结果
libgdal1-dev: /usr/bin/gdal-config
Run Code Online (Sandbox Code Playgroud)
所以我安装了libgdal1-dev,如下所示:
$ sudo apt-get install libgdal1-dev
Run Code Online (Sandbox Code Playgroud)
小智 6
发生这种情况是因为包“ rgdal”的配置失败,因此我们必须安装必要的依赖项。
软件包libgdal-dev和libproj-dev是必需的:
sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev
然后通过安装rgdal
install.packages("rgdal")
Run Code Online (Sandbox Code Playgroud)
通过加载rgdal
library(rgdal)
Run Code Online (Sandbox Code Playgroud)
在 CentOS 6 上试试这个
sudo yum install gdal gdal-python gdal-devel mapserver mapserver-python libxml2 libxml2-python python-lxml python-pip python-devel gcc
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
50121 次 |
| 最近记录: |