R 包RIdeogram安装报错

安装R 包RIdeogram时需要下载rsvg,rsvg的安装出现librsvg-2.0的缺失的解决办法

1. 安装方法


1.1 通过devtools安装

install.packages("devtools")
library(devtools)
devtools::install_github('TickingClock1992/RIdeogram')

1.2 直接安装

install.packages("RIdeogram")


2. 报错


begin installing package ‘grImport2’
begin installing package ‘rsvg’
make: *** [Makefile:9: rsvg.ts] Error 1
* installing *source* package ‘grImport2’ ...
** package ‘grImport2’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (grImport2)
make: Target 'all' not remade because of errors.
* installing *source* package ‘rsvg’ ...
** package ‘rsvg’ successfully unpacked and MD5 sums checked
** using staged installation
Package librsvg-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `librsvg-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'librsvg-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lrsvg
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the librsvg-2.0 library. Try installing:
 * deb: librsvg2-dev (Debian, Ubuntu, etc)
 * rpm: librsvg2-devel (Fedora, EPEL)
 * csw: librsvg_dev, sunx11_devel (Solaris)
 * brew: librsvg (OSX)
If librsvg-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a librsvg-2.0.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] ---------------------------
<stdin>:1:10: fatal error: librsvg/rsvg.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------

1. 有sudo权限的可以执行以下步骤:

sudo apt-get install librsvg2-bin
sudo apt-get install librsvg2-dev
install.packages("rsvg")
install.packages("RIdeogram")


2. 手动下载librsvg2库:

git clone https://github.com/GNOME/librsvg


有root权限

yum install librsvg2-devel


  • 发表于 2023-11-10 14:49
  • 阅读 ( 1351 )
  • 分类:R

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
Ti Amo
Ti Amo

50 篇文章

作家榜 »

  1. omicsgene 702 文章
  2. 安生水 351 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 82 文章
  6. rzx 78 文章
  7. 红橙子 78 文章
  8. CORNERSTONE 72 文章