R:在安装软件包时出现unloadNamespace(package)问题 [英] R: Problems with unloadNamespace(package) when installing a package
问题描述
我制作了一个名为TRIMmaps的R软件包,并尝试使用命令进行安装
I made an R-package called TRIMmaps and tried to install it with the command
R CMD INSTALL TRIMmaps_v1.12.0
我收到以下错误消息:
Error in unloadNamespace(package) :
namespace ‘Rcpp’ is imported by ‘plyr’ so cannot be unloaded
Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
"Rcpp" version 0.11.2 cannot be unloaded.
但是我确实需要plyr软件包,因为当我删除它时,会收到消息:
I do need package plyr, however, because when I remove it I get the message:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘plyr’
我删除了两个软件包plyr
和Rcpp
,然后再次安装它们.我当前的Rcpp
版本现在是0.11.5,但是当我再次尝试安装TRIMmaps-package时,我收到与上述相同的错误消息,包括行Rcpp version 0.11.2 cannot be unloaded
.尽管我已经删除了较旧的Rcpp版本,并将其替换为0.11.5,但是在这里,0.11.2仍然会出现问题.
I removed both packages plyr
and Rcpp
and installed them again. My current version of Rcpp
now is 0.11.5, but when I try to install the TRIMmaps-package again, I get the same error message as above including the line "Rcpp" version 0.11.2 cannot be unloaded
. Although I have removed the older Rcpp-version and replaces it by 0.11.5, here still a problem occurs with 0.11.2.
我该如何解决?任何提示表示赞赏.
How do I solve this? Any hint is appreciated.
推荐答案
我遇到类似的错误.复制它的最低条件似乎是:
I get a similar error. Minimal conditions to reproduce it seem to be:
-
Depend
在包装x
(在我的情况下为reshape
)上 - 在小插图中装入一个包
y
(在我的情况下为plyr
),该包也可以导入或依赖于x
.
Depend
on a packagex
(in my casereshape
)- In your vignette load a packge
y
(in my caseplyr
) that also imports or depends onx
.
如果在包装构建或检查过程之外构建小插图,则该小插图会很好地构建,但是会抛出您以其他方式表示的错误.该错误也是R版本的,并且可能是特定于站点的,因为在尝试在另一台计算机上构建软件包时,R 3.2.0消除了该错误.
The vignette builds fine if you build it outside of the package building or checking process, but throws the error that you indicate otherwise. The error is also R version and maybe site specific, since it goes away with R 3.2.0 when trying to build the package on a different machine.
这篇关于R:在安装软件包时出现unloadNamespace(package)问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!