gpt4 book ai didi

java - i.p(...) : installation of package . 中的错误 .. 具有非零退出状态

转载 作者:行者123 更新时间:2023-12-04 15:49:37 28 4
gpt4 key购买 nike

我尝试通过 devtools 安装 RDRPOSTagger 包。

devtools::install_github("bnosac/RDRPOSTagger", build_vignettes = TRUE)
Downloading GitHub repo bnosac/RDRPOSTagger@master
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 3.5 from http://cran.r-project.org/bin/windows/Rtools/.
√ checking for file 'C:\Users\X1\AppData\Local\Temp\RtmpUD2iwv\remotes70c59a944c1\bnosac-RDRPOSTagger-af51e38/DESCRIPTION' ...
- preparing 'RDRPOSTagger': (1.1s)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'RDRPOSTagger_1.1.tar.gz'

Installing package into ‘C:/Users/X1/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'RDRPOSTagger' ...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'RDRPOSTagger'
finding HTML links ... done
rdr_add_space_around_punctuations html
rdr_available_models html
rdr_model html
rdr_pos html
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
Error: package or namespace load failed for 'rJava':
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
Error : package 'rJava' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/X1/Documents/R/win-library/3.5/RDRPOSTagger'
In R CMD INSTALL
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/X1/AppData/Local/Temp/RtmpUD2iwv/file70c8917649/RDRPOSTagger_1.1.tar.gz’ had non-zero exit status

类(class)信息:

sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

我的 CPU 上的 Java 版本:java 10.0.2 64 位

我尝试使用 qdap 包,它也需要 rJava 并且工作正常。

最佳答案

错误:无法加载包“rJava”

由于未设置 JAVA_HOME,因此未加载此包。

这可以通过首先安装来完成,具体取决于您的 R(32 位或 64 位)、Java 32 位或 64 位。

从这里下载 java:https://www.java.com/en/download/

使用这个查找 JAVA_HOME 地址:

find.java <- function() {
for (root in c("HLM", "HCU")) for (key in c("Software\\JavaSoft\\Java Runtime Environment",
"Software\\JavaSoft\\Java Development Kit")) {
hive <- try(utils::readRegistry(key, root, 2),
silent = TRUE)
if (!inherits(hive, "try-error"))
return(hive)
}
hive
}

加载find.java,你会找到JAVA_HOME的地址。在此处输入该地址:

Sys.setenv(JAVA_HOME='C:\\Your\\Java\\Directory')
library(rJava)

这应该加载包 rJava

错误:“i386”加载失败

这个错误可能是因为您已经下载了两个版本的 R(32 位和 64 位)并且 devtools 尝试为它们构建。

你可以使用这个:

devtools::install_github("mne-tools/mne-r", INSTALL_opts=c("--no-multiarch"))

我也遇到了类似类型的错误,在搜索之后我发现了这个对我有用的解决方案。

关于java - i.p(...) : installation of package . 中的错误 .. 具有非零退出状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54408464/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com