作者clsmbstu (missing)
看板R_Language
标题[问题] 无法在CentOS 7上安装rgeos和leaflet
时间Sat May 12 00:23:52 2018
[问题类型]:
程式谘询(我想用R 做某件事情,但是我不知道要怎麽用R 写出来)
经验谘询(我想用R 连接某些资料库,请问大家的经验)
[软体熟悉度]:
使用者(已经有用R 做过不少作品)
[问题叙述]:
我想要试着玩玩看在Google Cloud Platform上面架Shiny Server,
但遇到不少问题,还在一个个解决中,
现在遇到的状况是安装leaflet和rgeos这两个套件都会失败。
[程式范例]:
```shell
sudo su - -c "R -e \"install.packages(c('rgeos', 'leaflet'), repo='
https://cloud.r-project.org/')\""
```
大概从这里开始有问题:
/bin/sh: libpng-config: command not found
read.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
^
compilation terminated.
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘png’
* removing ‘/usr/lib64/R/library/png’
* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgeos: 0.3-26
checking for /usr/bin/svnversion... no
configure: svn revision: 560
checking for geos-config... no
no
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/usr/lib64/R/library/rgeos’
ERROR: dependency ‘png’ is not available for package ‘leaflet’
* removing ‘/usr/lib64/R/library/leaflet’
The downloaded source packages are in
‘/tmp/RtmpboBa5A/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages(c("rgeos", "leaflet"), repo = "
https://cloud.r-project.org/") :
installation of package ‘png’ had non-zero exit status
2: In install.packages(c("rgeos", "leaflet"), repo = "
https://cloud.r-project.org/") :
installation of package ‘rgeos’ had non-zero exit status
3: In install.packages(c("rgeos", "leaflet"), repo = "
https://cloud.r-project.org/") :
installation of package ‘leaflet’ had non-zero exit status
[环境叙述]:
R version 3.4.4 (2018-03-15)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
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=en_US.UTF-8 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
loaded via a namespace (and not attached):
[1] compiler_3.4.4
[关键字]:
CentOS, leaflet, rgeos
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 36.225.142.139
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/R_Language/M.1526055836.A.132.html
※ 编辑: clsmbstu (36.225.142.139), 05/12/2018 00:24:30
1F:→ obarisk: why cents?deb family不好吗? 05/12 00:32
2F:→ obarisk: yum provides lining.h 05/12 00:32
3F:→ obarisk: sorry, yum provides png.h 05/12 00:33
4F:→ obarisk: 大概是什麽png-devel之类的 05/12 00:34
5F:→ clsmbstu: 没有好不好 只是以前待的地方是用CentOS 就习惯了 @@ 05/12 00:43
6F:→ clsmbstu: sudo yum provides png.h 的结果是 No matches found 05/12 00:44
我做了sudo yum install libpng-static libpng-devel,
leaflet装起来了,但rgeos还是没有:
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/usr/lib64/R/library/rgeos’
The downloaded source packages are in
‘/tmp/RtmpGWuoCR/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(c("rgeos"), repo = "
https://cloud.r-project.org/") :
installation of package ‘rgeos’ had non-zero exit status
刚刚试了sudo yum install libgeos*再装rgeos,还是失败。
※ 编辑: clsmbstu (36.225.142.139), 05/12/2018 00:58:19
7F:→ clsmbstu: 原来是:sudo yum install geos geos-devel,解决了... 05/12 01:07
※ 编辑: clsmbstu (36.225.142.139), 05/12/2018 01:08:40