程序包相关性错误“没有名为"stringi"的程序包"; [英] Package dependency error "there is no package called ‘stringi’"

查看:334
本文介绍了程序包相关性错误“没有名为"stringi"的程序包";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个R包并将其加载到github( microdadosBrasil ).当我尝试以用户身份安装软件包时,出现以下错误:

I created an R package and loaded it to github (microdadosBrasil). When I try to install the package (as a user would) I get the following error:

devtools::install_github("lucasmation/microdadosBrasil")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘stringi’

我尝试通过在软件包依赖项中添加 stringi 来解决此问题 在"DESCRIPTION"中包括:

I tried solving this by adding stringi to the package dependencies In DESCRIPTION in included:

Imports:
    stringi

我还在NAMESPACE中包括了软件包导入

I also included the package import at NAMESPACE

import(stringi)

但是,即使那样,我仍然遇到相同的安装错误. 简而言之,我什至不知道我的包中使用stringi包的任何显式函数.

But, even then I get the same installation error. To be hones I'm not even aware of any explicit function in my package that uses the stringi package.

如果我先安装stringi,则microdadosBrasil安装有效:

If I install stringi before then the microdadosBrasil installation works:

install.packages('stringi')
devtools::install_github("lucasmation/microdadosBrasil")

这是发生错误时的会话信息(在预安装stringi之前)

This is the session information when error occurs (before pre-installing stringi)

sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
[5] LC_TIME=Portuguese_Brazil.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.1.3

推荐答案

问题是由于软件包的依赖性所致,因为一个软件包在另一个软件包中调用文件,依此类推(例如递归).因此,首先尝试安装该程序包的所有依赖项,然后绝对可以使用该程序包.

The problem is due to dependencies of packages because one package calls file in another package and so on (like recursion). So first try to install all dependencies of the package then definitely this package will work.

这篇关于程序包相关性错误“没有名为"stringi"的程序包";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆