0

It won't load the library.

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.

I manually checked the file path and ROracle.dll is there.

EDIT:

I have RODBC and RJDBC working. I just don't understand why ROracle won't install:

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’

I'm guessing there are Oracle files that need installing, but none of the documentation is very clear.

Oli
  • 532
  • 1
  • 5
  • 26
  • not sure if this particular link may be helpful.. http://stackoverflow.com/questions/30034542/unable-to-load-any-package-in-r-unable-to-load-shared-object – ArunK Jul 05 '16 at 07:29
  • I thought of this, which is why I changed the directory from a network drive to C:/ – Oli Jul 05 '16 at 07:35
  • hmmm, may be if you mention the location of ROracle in `library("ROracle",lib.loc="location-to-ROracle")`. Does this make a difference? – ArunK Jul 05 '16 at 08:33
  • no library trees found in 'lib.loc' – Oli Jul 05 '16 at 10:03
  • > .libPaths() [1] "C:/Users/***/Documents/R/win-library/3.3" [2] "C:/Program Files/R/R-3.3.0/library" – Oli Jul 05 '16 at 10:05
  • "ERROR: cannot find Oracle Client. Please set OCI_LIB64 to specify its location." – Oli Oct 05 '16 at 13:12
  • I think using RJDBC to connect Oracle seem easier than using ROracle – stellar Aug 19 '16 at 09:25
  • But performance wise its not as good – Oli Oct 05 '16 at 12:00

1 Answers1

2

In order for ROracle to install and load properly, you should have Oracle Client 64-bit and Windows 64-bit. Once I installed 64-bit Oracle Client on my machine, this error went away.

SophiaC
  • 46
  • 7