在Linux上安装R软件包“ rgeos”:找不到geos-config或不可执行

时间:2018-11-20 08:45:47

标签: r package gentoo

我在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和R 3.5.1的Centos 7.5上安装rgeos,也会发生同样的情况)

尽管在上面提到的tar文件中有一个rgeos/configure可执行文件,但实际上那里没有geos-config

如何安装rgeos软件包?

也许我可以下载一个二进制版本?

4 个答案:

答案 0 :(得分:2)

我找到了解决方法。

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

在gentoo中,我必须做:

EntityX{
@ManyToOne
EntityA entityA; 
}

在CentOS中:

sudo emerge --ask sci-libs/geos

在安装这些库之后,我启动了R,可以毫无问题地安装'rgeos'软件包

答案 1 :(得分:2)

对于Ubuntu(19.10及更高版本),请使用:

sudo apt install libgeos-dev

答案 2 :(得分:1)

对于Ubuntu 20.04,解决方案是:

sudo apt install libgeos-dev

答案 3 :(得分:-2)

对于 Arch/Manjaro:

   sudo pacman -S geos