首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Renv安装devtools而不出现错误

如何使用Renv安装devtools而不出现错误
EN

Stack Overflow用户
提问于 2022-09-12 13:10:58
回答 1查看 412关注 0票数 2

Renv,无法安装devtools

devtools.

  • Actual

  • 目标:使用

  • 预期结果安装devtools :安装

  • 结果:参见

下面的错误

我尝试通过renv (在Ubuntu上)在RStudio中安装软件包,以用于我自己的软件包。我执行了Renv (),除了devtools之外,包将安装。当我试图通过renv::install ()安装devtools时,我得到以下错误:

代码语言:javascript
复制
> renv::install("devtools")
Retrieving 'https://cran.rstudio.com/src/contrib/devtools_2.4.4.tar.gz' ...
    OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/pkgdown_2.0.6.tar.gz' ...
    OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/ragg_1.2.2.tar.gz' ...
    OK [file is up to date]
Installing ragg [1.2.2] ...
    FAILED
Error installing package 'ragg':
================================

* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4. 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 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4.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:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/home/SmitsG/Documents/Projects/{"package_location"}/renv/staging/1/ragg’
Error: install of package 'ragg' failed [error code 1]

因此,这导致了以下错误:

  • No package 'libtiff-4‘找到了
  • :1:22:致命错误: ft2build.h:没有这样的文件,也没有安装软件包“ragg”失败的错误代码1

我尝试了以下几点:

其他包环境中的

libfreetype。因此,我尝试从tar.gz和CRAN为renv安装libfreetype (这不是自动安装的)。这没有成功。--

代码语言:javascript
复制
Package libtiff-4 was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libtiff-4.pc'
    to the PKG_CONFIG_PATH environment variable

我找到了这个链接:https://github.com/numworks/epsilon/issues/592,其中设置了PKG_CONFIG_PATH。但我认为只有通过renv安装libfreetype才能做到这一点。

代码语言:javascript
复制
{:~/path_to_package}$ pkg-config --cflags freetype2-I/usr/include/freetype2 
-I/usr/include/libpng16

{:~/path_to_package}$ pkg-config --libs --cflags libtiff-4Package libtiff-4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtiff-4.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtiff-4' found
EN

回答 1

Stack Overflow用户

发布于 2022-10-01 21:21:05

我是linux的新手,我发现安装R包可能非常令人沮丧,因为(1)有许多linux依赖项需要首先安装,(2)需要永远安装。下面是一个脚本,它安装了在我的系统上安装R时发现的依赖项(Linux 21,Vanessa)。

代码语言:javascript
复制
sudo apt update
sudo apt install -q \
  cargo \
  cmake \
  default-jdk \ 
  fonts-roboto \
  htop \
  libcairo2-dev \
  libclang-dev \
  libcurl4-openssl-dev \
  libfontconfig1-dev \
  libfreetype6-dev \
  libfribidi-dev \
  libgdal-dev \
  libgeos-dev \
  libharfbuzz-dev \
  libjpeg-dev \
  libproj-dev \
  libpng-dev \
  libpq-dev \
  libsodium-dev \
  libssl-dev \
  libtiff5-dev \
  libudunits2-dev \
  libx11-dev \
  libxml2-dev \
  openjdk-8-jdk \
  openjdk-8-jre \
  pandoc \
  ttf-mscorefonts-installer \
  xorg-dev 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73689906

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档