【问题标题】:Error : .onLoad failed in loadNamespace() for 'rJava', details: call: inDL(x, as.logical(local), as.logical(now), ...)错误:'rJava' 的 loadNamespace() 中的 .onLoad 失败,详细信息:调用:inDL(x, as.logical(local), as.logical(now), ...)
【发布时间】:2021-02-11 11:46:17
【问题描述】:

我正在尝试安装软件包 - Retip。从 GitHub 下载并尝试运行它。

我正在接受这种按摩:

Error: package or namespace load failed for 'Retip':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'D:/BCDD/Documents/R/win-library/4.0/rJava/libs/i386/rJava.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.

Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'D:/BCDD/Downloads/Retip-master/Retip.Rcheck/Retip'

1 error x | 0 warnings v | 0 notes v
Error: R CMD check found ERRORs
Execution halted

Exited with status 1.

我不知道该怎么办。我尝试安装\卸载'rJava'几次。 还针对最新的 Java 版本进行了更新。

我的会话信息:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] rcdk_3.5.0     rcdklibs_2.3   rJava_0.9-13   devtools_2.3.2 usethis_2.0.0 

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13   magrittr_2.0.1    itertools_0.1-3   fingerprint_3.5.7 pkgload_1.1.0     R6_2.5.0          rlang_0.4.10     
 [8] fastmap_1.0.1     tools_4.0.3       parallel_4.0.3    pkgbuild_1.2.0    png_0.1-7         sessioninfo_1.1.1 cli_2.3.0        
[15] withr_2.4.1       iterators_1.0.13  ellipsis_0.3.1    remotes_2.2.0     assertthat_0.2.1  rprojroot_2.0.2   lifecycle_0.2.0  
[22] crayon_1.4.1      processx_3.4.5    purrr_0.3.4       callr_3.5.1       fs_1.5.0          ps_1.5.0          curl_4.3         
[29] testthat_3.0.1    memoise_2.0.0     glue_1.4.2        cachem_1.0.3      compiler_4.0.3    desc_1.2.0        prettyunits_1.1.1

我的 Java 版本

Z:\> java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)

任何提示/帮助将不胜感激

【问题讨论】:

  • 关于您的错误,您似乎安装了错误的 java 版本。它抱怨它不是有效的 32 位。这表明它需要一个 32 位系统(这有点奇怪)。我会假设它正在尝试加载 java 32 位,而它实际上应该加载 java 64 位。
  • 尝试在install.packages的参数中包含INSTALL_opts = "--no-multiarch"
  • @Oliver - 感谢您指出这一点,您有什么想法/建议如何强制 R 使用 64 位?非常感谢!
  • @SmokeyShakers - 谢谢你的建议!它解决了这个问题:) 非常感谢!

标签: java r dll rjava


【解决方案1】:

以下是我对INSTALL_opts = "--no-multiarch" 为何有效的理解。我相信较新版本的 R 会尝试为这两种架构安装。这通常不是问题,除非您的包具有仅存在于您的计算机上的一种架构的系统依赖项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-23
    • 2015-12-03
    • 2016-10-10
    • 1970-01-01
    • 2015-07-08
    • 1970-01-01
    相关资源
    最近更新 更多