r - 在 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
安装包?
是否有我可以下载的二进制版本?
解决方案
我找到了解决方案。
“rgeos”包取决于在运行 R 之前必须安装的库。
在 gentoo 我必须这样做:
sudo emerge --ask sci-libs/geos
在 CentOS 中:
sudo yum install geos geos-devel
安装这些库后,我启动了 R 并且可以毫无问题地安装“rgeos”包
推荐阅读
- python-3.x - Python:为什么我的正弦波不会改变频率
- javascript - 关于自动刷新一部分在 php 文件中
- rust - 有没有办法将随机数生成器存储为特征对象?
- django - Django NoReverseMatch 使用 views 参数
- javascript - 购物车项目的布尔值在刷新时消失
- c++ - C++ 中的输入流。与 cin unget() 函数有点混淆
- python - 从 Python DataFrame 的行/列数据中生成对
- mp4 - PPS 内容后得到未知数据
- core-data - 如何用 ObservedObject 和 NSManagedObject 制作 Picker?
- spark-koalas - 使用 assign 在 Koalas DataFrame 中添加新列