0056-【R-bioconductor】-KEGG通路分析R包安装失败解决-pathview

1. 安装

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help
A new version of Bioconductor is available after installing the most recent version of R; see http://bioconductor.org/install
# 设置国内华科镜像
> options(BioC_mirror="http://mirrors.ustc.edu.cn/bioc/")
> biocLite("pathview")

2. 安装报错显示

缺一下软件,需要在ubuntu下的系统进行安装,而不是实用R来安装补充

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.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: configuration failed for package ‘curl’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/curl’
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.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: configuration failed for package ‘openssl’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/openssl’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/XML’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/httr’
ERROR: dependency ‘XML’ is not available for package ‘KEGGgraph’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/KEGGgraph’
ERROR: dependency ‘httr’ is not available for package ‘KEGGREST’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/KEGGREST’
ERROR: dependencies ‘KEGGgraph’, ‘XML’, ‘KEGGREST’ are not available for package ‘pathview’
* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/pathview’

The downloaded source packages are in
    ‘/tmp/RtmphFHfs8/downloaded_packages’
installation path not writeable, unable to update packages: backports, bindr, bindrcpp, data.table, dplyr, Formula, highr, htmlTable,
  htmlwidgets, knitr, munsell, pillar, purrr, Rcpp, reshape2, rlang, stringi, stringr, tibble, tidyr, utf8, viridis, yaml, cluster,
  foreign, MASS, Matrix, mgcv, nlme, survival
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘openssl’ had non-zero exit status
3: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘XML’ had non-zero exit status
4: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘httr’ had non-zero exit status
5: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘KEGGgraph’ had non-zero exit status
6: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘KEGGREST’ had non-zero exit status
7: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘pathview’ had non-zero exit status

3. 安装系统依赖包,实用R来安装,报错

> install.packages("XML")
Installing package into ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.11.tar.gz'
Content type 'application/x-gzip' length 1599533 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* package ‘XML...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML* removing ‘/home/toucan/R/x86_64-pc-linux-gnu-library/3.4/XML’
Warning in install.packages :
  installation of package ‘XML’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmphFHfs8/downloaded_packages’

4. 实用ubuntu下进行安装,最终所有安装成功

解决方法:
1. 安装

$sudo apt-get install r-cran-xml

无效报错依旧

  1. 安装
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev

# 或者
sudo apt-get install libcurl4-openssl-dev libxml2-dev
  1. 加载库成功,说明缺上面的包,问题已解决
 library(XML)
  1. 继续根据报错安装
sudo apt-get install libssl-dev
  1. 最终安装成功
library("pathview")

你可能感兴趣的:(0056-【R-bioconductor】-KEGG通路分析R包安装失败解决-pathview)