作者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/m.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