R 安装 devtools 报错信息

在编译spark源码时遇到sparkr有依赖R环境,当然一般用不到sparkr时可以不加入编译

在安装R环境和一些依赖包时遇到一些问题

Rscript -e "install.packages(c('knitr', 'rmarkdown', 'devtools', 'testthat', 'e1071', 'survival'), repos='http://mirrors.tuna.tsinghua.edu.cn/CRAN/')"

遇到 安装 devtools时

ERROR: configuration failed for package ‘textshaping’
* removing ‘/usr/lib64/R/library/textshaping’
ERROR: dependency ‘textshaping’ is not available for package ‘ragg’
* removing ‘/usr/lib64/R/library/ragg’
ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’
* removing ‘/usr/lib64/R/library/pkgdown’
ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’
* removing ‘/usr/lib64/R/library/devtools’

  installation of package ‘textshaping’ had non-zero exit status

尝试先安装  textshaping

>install.packages('textshaping')

报错

--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the harfbuzz freetype2 fribidi library. Try installing:
 * deb: libharfbuzz-dev libfribidi-dev (Debian, Ubuntu, etc)
 * rpm: harfbuzz-devel fribidi-devel (Fedora, EPEL)
 * csw: libharfbuzz_dev libfribidi_dev (Solaris)
 * brew: harfbuzz fribidi (OSX)
If harfbuzz freetype2 fribidi is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a harfbuzz freetype2 fribidi.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
:1:19: fatal error: hb-ft.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘textshaping’
* removing ‘/usr/lib64/R/library/textshaping’

在centos 7中直接 复制 * rpm 那个提示

yum install harfbuzz-devel fribidi-devel

安装完再接着进入R交互命令安装

>install.packages('textshaping')

同理,在遇到 安装 ragg 时的错误

No package 'libjpeg' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4 libjpeg. Try installing:
 * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
 * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
 * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 libjpeg is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4 libjpeg.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
:1:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/usr/lib64/R/library/ragg’

使用yum 安装 * rpm那一行,后面也有centos的提示

yum freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel

再接着安装 ragg,devtools 就都可以安装成功了

>install.packages('ragg')
>install.packages('devtools')

你可能感兴趣的:(r语言,java,开发语言)