失败,错误:“operator"不是一个有效的安装包 [英] Failed with error: ‘‘operator’ is not a valid installed package

查看:63
本文介绍了失败,错误:“operator"不是一个有效的安装包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在加载从 github 下载的 R 包时遇到问题(https://github.com/hafen/operator).我下载了这个包并将它放在我本地的 R 文件夹中:C:/..../Documents/R/win-library/3.2/operator".

但是,我无法将所述包加载到 R 中.在尝试加载包时,我不断收到以下错误.谁能帮我.我发现了一个错误,虽然我认为它有点相关,但它建议更新我已经完成但没有成功的Rcpp".在此先感谢您的任何帮助!

我应该补充.我对此进行了更多研究,并意识到我遇到的问题是围绕包中包含的 C 脚本.如果我删除 C 脚本,我可以加载包,但是,一些包函数依赖于脚本,因此不会运行.

<代码>>要求(操作员)加载所需的包:操作员失败,错误:operator"不是一个有效的安装包"

<代码>>devtools::load_all("C:/..../Documents/R/win-library/3.2/operator")加载操作符重新编译运算符"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \"C:\Users\blakey1\Documents\R\win-library\3.2\operator"\--library="C:\Users\blakey1\AppData\Local\Temp\Rtmpe611i9\devtools_install_499c5059149c" --no-R --no-data \--no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch --no-test-load* 安装 *source* 包 'operator' ...** 库警告:运行命令 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" SHLIB="operator.dll" WIN=64 TCLBIN=64 OBJECTS="loess_op.o"' 状态为 127错误:包operator"的编译失败* 删除C:/Users/blakey1/AppData/Local/Temp/Rtmpe611i9/devtools_install_499c5059149c/operator"错误:命令失败 (1)

解决方案

我在使用 RTextTools 时遇到了同样的问题,因为 RTextTools 现在在 CRAN 上不可用.

我从给定的链接下载了 RTextTools

https://cran.r-project.org/src/contrib/Archive/RTextTools/

并复制项目根文件夹中的 RTextTools_1.4.2.tar.gz 文件然后在终端的项目文件夹中运行此命令
R CMD 安装 RTextTools_1.4.2.tar.gz"运行此命令后,我收到以下错误错误:依赖项 'SparseM'、'randomForest'、'tree'、'e1071'、'ipred'、'caTools'、'maxent'、'glmnet'、'tau' 不可用于包 'RTextTools'"

现在只需运行此代码即可从 RStudio 或 RConsole(您使用的任何编辑器)安装每个依赖项

<块引用>

install.packages("caTools")一一安装所有 9 个必需的软件包(在我的情况下,它是 RTextTools 所需的 9 个软件包依赖项)将安装除maxent"外的所有软件包

现在从给定的链接下载 maxenthttps://cran.r-project.org/src/contrib/Archive/maxent/

然后将 maxent_1.3.3.1.tar 文件复制到项目文件夹中在终端的项目文件夹中运行此命令
"R CMD INSTALL maxent_1.3.3.1.tar"

现在对于 RTextTools 在终端中再次运行此命令"R CMD 安装 RTextTools_1.4.2.tar.gz"

现在一切都完成了..

但最后一步是

使用

加载 RTextTools<块引用>

库(RTextTools)

您会再看到一个错误:Load SparseM现在加载 SparseM 使用下面的代码

<块引用>

图书馆(SparseM)

并在最后加载 RTextTools

<块引用>

库(RTextTools)

Currently I am having problems with loading an R package that I downloaded from github (https://github.com/hafen/operator). I downloaded the package and put it in my local R folder: "C:/..../Documents/R/win-library/3.2/operator".

However, I have not been able to load said package into R. I keep on receiving the following errors when trying to load the package. Can anyone help me. I found an error that I though was somewhat relevant that suggest updating "Rcpp" which I have already done with no success. Thank you in advance for any and all help!

I should add. I looked into this a bit more and realized the issue I am having is revolving around the C script that is contained within the package. If I remove the C script I can load the package, however, some of the package functions are dependent on the script and will not run as a result.

> require(operator)
Loading required package: operator
Failed with error:  ‘‘operator’ is not a valid installed package’

or

> devtools::load_all("C:/..../Documents/R/win-library/3.2/operator")
Loading operator
Re-compiling operator
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
"C:\Users\blakey1\Documents\R\win-library\3.2\operator"  \
--library="C:\Users\blakey1\AppData\Local\Temp\Rtmpe611i9\devtools_install_499c5059149c" --no-R --no-data  \
--no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch --no-test-load 

* installing *source* package 'operator' ...
** libs
Warning: running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" SHLIB="operator.dll" WIN=64 TCLBIN=64 OBJECTS="loess_op.o"' had status 127
ERROR: compilation failed for package 'operator'
* removing 'C:/Users/blakey1/AppData/Local/Temp/Rtmpe611i9/devtools_install_499c5059149c/operator'
Error: Command failed (1)

解决方案

I was facing the same issue with RTextTools, as RTextTools is now not available on CRAN.

I have Download RTextTools From Given Link

https://cran.r-project.org/src/contrib/Archive/RTextTools/

and copy RTextTools_1.4.2.tar.gz file in project root folder then run this command in project folder in terminal
"R CMD INSTALL RTextTools_1.4.2.tar.gz" After running this command I receive below error "ERROR: dependencies ‘SparseM’, ‘randomForest’, ‘tree’, ‘e1071’, ‘ipred’, ‘caTools’, ‘maxent’, ‘glmnet’, ‘tau’ are not available for package ‘RTextTools’"

Now install each dependencies from RStudio or RConsole (Any Editor used by you) by simply running this code

install.packages("caTools") Install all 9 required packages One By One (In My Case it was 9 Packages Dependencies required by RTextTools) all packages will be installed except 'maxent'

Now download maxent from the given link https://cran.r-project.org/src/contrib/Archive/maxent/

and copy maxent_1.3.3.1.tar file in project folder then run this command in project folder in terminal
"R CMD INSTALL maxent_1.3.3.1.tar"

Now For RTextTools Run this command again in Terminal "R CMD INSTALL RTextTools_1.4.2.tar.gz"

All is done Now..

But the Last Step is

Load the RTextTools using

library(RTextTools)

You will see one more Error: Load SparseM Now Loading SparseM use code below

library(SparseM)

and in the last Load RTextTools

library(RTextTools)

这篇关于失败,错误:“operator"不是一个有效的安装包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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