首页 > 解决方案 > 在 linux 上安装 R 包“rgeos”:找不到 geos-config 或不可执行

问题描述

我在 gentoo 上运行 R 3.4.1。当我尝试安装“rgeos”包时,我得到了这个:

> install.packages("rgeos")
Installing package into ‘/home/jody/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://stat.ethz.ch/CRAN/src/contrib/rgeos_0.4-2.tar.gz'
Content type 'application/x-gzip' length 255244 bytes (249 KB)
==================================================
downloaded 249 KB

* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: x86_64-pc-linux-gnu-gcc
configure: CXX: x86_64-pc-linux-gnu-g++
configure: rgeos: 0.4-2
checking for /usr/bin/svnversion... yes
configure: svn revision: 581
checking for geos-config... no
no
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/home/jody/R/x86_64-pc-linux-gnu-library/3.4/rgeos’

The downloaded source packages are in
    ‘/tmp/RtmppEeDps/downloaded_packages’
Warning message:
In install.packages("rgeos") :
  installation of package ‘rgeos’ had non-zero exit status

(如果我尝试使用 R 3.5.1 在 gentoo 上安装 rgeos,以及使用 R 3.5.1 在 Centos 7.5 上安装 rgeos,也会发生同样的情况。)

虽然rgeos/configure上面提到的 tar 文件中有一个可执行文件,但其中确实没有geos-config

我怎样才能rgeos安装包?

是否有我可以下载的二进制版本?

标签: rpackagegentoo

解决方案


我找到了解决方案。

“rgeos”包取决于在运行 R 之前必须安装的库。

在 gentoo 我必须这样做:

sudo emerge --ask sci-libs/geos

在 CentOS 中:

sudo yum install geos geos-devel

安装这些库后,我启动了 R 并且可以毫无问题地安装“rgeos”包


推荐阅读