[問題] 無法在CentOS 7上安裝rgeos和leaflet

作者: clsmbstu   2018-05-12 00:23:52
[問題類型]:
程式諮詢(我想用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
作者: obarisk (OSWALT)   2018-05-12 00:32:00
why cents?deb family不好嗎?yum provides lining.hsorry, yum provides png.h大概是什麼png-devel之類的
作者: clsmbstu   2018-05-12 00:43:00
沒有好不好 只是以前待的地方是用CentOS 就習慣了 @@sudo yum provides png.h 的結果是 No matches found原來是:sudo yum install geos geos-devel,解決了...

Links booklink

Contact Us: admin [ a t ] ucptt.com