我无法在Windows 10 64位PC上安装软件包。我已经安装了R的最新版本,这是安装RJDBC所必需的,并且rJava可以在我依赖的所有其他软件包上加载和运行,而没有任何问题。以下是运行一些检查的结果:
> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.2 tools_3.6.2 mongolite_2.1.0 jsonlite_1.6.1
> Sys.getenv("JAVA_HOME")
[1] "C:\\Program Files\\Java\\jdk-13.0.2"
> library(rJava)
> .jinit()
> .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
[1] "13.0.2+8"
但是,当我尝试安装该软件包时,失败如下:
> devtools::install_github("snowflakedb/dplyr-snowflakedb")
Downloading GitHub repo snowflakedb/dplyr-snowflakedb@master
√ checking for file 'C:\Users\xxxx\AppData\Local\Temp\RtmpWkzKSM\remotes326067c2358a\snowflakedb-dplyr-snowflakedb-a4299ad/DESCRIPTION' ...
- preparing 'dplyr.snowflakedb':
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'dplyr.snowflakedb_0.3.0.tar.gz'
Installing package into ‘C:/Users/xxxx/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'dplyr.snowflakedb' ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'dplyr.snowflakedb'
finding HTML links ... done
SnowflakeDBConnection-class html
db_snowflake_copy html
dplyr.snowflakedb html
lahman html
lahman_snowflakedb html
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'rJava':
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/xxxx/R/win-library/3.6/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error : package 'rJava' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/xxxx/R/win-library/3.6/dplyr.snowflakedb'
Error: Failed to install 'dplyr.snowflakedb' from GitHub:
(converted from warning) installation of package ‘C:/Users/xxxx/AppData/Local/Temp/RtmpWkzKSM/file326067fe7d41/dplyr.snowflakedb_0.3.0.tar.gz’ had non-zero exit status
仅当您安装了32位版本的JDK时,程序包才起作用吗?但是我被告知,如果您正在运行64位版本的R,则无法在32位Java安装中运行rJava
。
FYI:看来这在git存储库问题中已解决:https://github.com/snowflakedb/dplyr-snowflakedb/issues/1#issuecomment-239830188