2016-07-04 83 views
0

它不会加载库。R连接到Oracle - 库(ROracle)失败

setwd("C:/Users/***/Desktop") 
install.packages('ROracle_1.2-1.zip', repos = NULL) 
#Installing package into ‘C:/Users/***/Documents/R/win-library/3.3 (as ‘lib’ is unspecified) 

#package ‘ROracle’ successfully unpacked and MD5 sums checked 

library('ROracle') 
#Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Users/***/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll': LoadLibrary failure: The specified module could not be found. 

我手动检查文件路径和ROracle.dll在那里。

编辑:

我有RODBC和RJDBC工作。我只是不明白为什么ROracle不会安装:

library(ROracle) 
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
    unable to load shared object 'C:/Users/robsoo01/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll': 
    LoadLibrary failure: The specified module could not be found. 

Error: package or namespace load failed for ‘ROracle’ 
install.packages("ROracle") 
Installing package into ‘C:/Users/***/Documents/R/win-library/3.3’ 
(as ‘lib’ is unspecified) 
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’ 
Do you want to attempt to install these from sources? 
y/n: y 
installing the source package ‘ROracle’ 

trying URL 'https://cran.rstudio.com/src/contrib/ROracle_1.2-2.tar.gz' 
Content type 'application/x-gzip' length 304229 bytes (297 KB) 
downloaded 297 KB 

* installing *source* package 'ROracle' ... 
** package 'ROracle' successfully unpacked and MD5 sums checked 
ERROR: cannot find Oracle Client. 
     Please set OCI_LIB64 to specify its location. 
Warning: running command 'sh ./configure.win' had status 1 
ERROR: configuration failed for package 'ROracle' 
* removing 'C:/Users/***/Documents/R/win-library/3.3/ROracle' 
* restoring previous 'C:/Users/***/Documents/R/win-library/3.3/ROracle' 
Warning in install.packages : 
    running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\***\Documents\R\win-library\3.3" C:\Users\***\AppData\Local\Temp\RtmpMvcLO4/downloaded_packages/ROracle_1.2-2.tar.gz' had status 1 
Warning in install.packages : 
    installation of package ‘ROracle’ had non-zero exit status 

The downloaded source packages are in 
    ‘C:\Users\***\AppData\Local\Temp\RtmpMvcLO4\downloaded_packages’ 

我猜想有Oracle文件需要安装,但没有一个文件非常清晰。

+0

不知道这个特定的链接可能会有所帮助.. http://stackoverflow.com/questions/30034542/unable-to-load-any-package-in-r-unable-to-load-shared-object – theArun

+0

我想到了这一点,这就是为什么我将目录从网络驱动器改为C:/ –

+0

hmmm,可能是因为你在'library(“ROracle”,lib.loc =“location-to-ROracle “)'。这是否有所作为? – theArun

回答

1

为了使ROracle正确安装和加载,您应该拥有Oracle客户端64位和Windows 64位。一旦我在我的机器上安装了64位Oracle客户端,此错误就消失了。