how to install r package for oracle on windows 10 64 bit

我的梦境 提交于 2019-12-08 04:56:51

问题


while installing rpackage Roracle on windows 10 i'm getting stuck at this point

install.packages("ROracle")
Installing package into ‘C:/Users/admin/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.3-1.tar.gz'
Content type 'application/x-gzip' length 308252 bytes (301 KB)
downloaded 301 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/admin/Documents/R/win-library/3.3/ROracle'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\admin\Documents\R\win-library\3.3" C:\Users\admin\AppData\Local\Temp\RtmpGYlz5L/downloaded_packages/ROracle_1.3-1.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\admin\AppData\Local\Temp\RtmpGYlz5L\downloaded_packages’

I've installed Rtools Rtools33.exe and my R version is version.string R version 3.3.2 (2016-10-31) please help to connect it with oracle 11g database

Oracle client is intalled in d drive which path is: D:\app\admin\product\11.2.0\client_1\BIN


回答1:


As @Nathan Dobie mentionned, instructions on the ROracle installation were helpful for me. I didn't need Rtools.exe but i had to add oracle instant client in the Environment variables.

Configuration in 64bits:

  • Under System variables, create OCI_LIB64 if it does not already exist. Set the value of OCI_LIB64 to D:\app\admin\product\11.2.0\client_1\BIN (in your case)
  • Under System variables, edit PATH to include D:\app\admin\product\11.2.0\client_1\BIN

And you will also need to create OCI_INC with the following value D:\app\admin\product\11.2.0\client_1\oci\include

Worked very well for me :-)



来源:https://stackoverflow.com/questions/42664588/how-to-install-r-package-for-oracle-on-windows-10-64-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!