How to install ROracle package on Windows 7?
Asked Answered
M

8

22

I'm trying to install ROracle package on my Windows 7 client. I have Oracle Instant client and Rtools installed, DBI package is istalled, OCI32_LIB environmental variable has been set. But when I try to install from command line:

C:\Temp>R CMD INSTALL --build ROracle_1.1-10.tar.gz
* installing to library 'C:/Users/myaccount/Documents/R/win-library/3.0'
* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
ERROR: configuration failed for package 'ROracle'
* removing 'C:/Users/myaccount/Documents/R/win-library/3.0/ROracle'

C:\Temp>

When I try to install from source:

> install.packages("ROracle",type = "source")
Warning in install.packages :
  package ‘ROracle’ is not available (for R version 3.0.0)
Installing package into ‘C:/Users/myaccount/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.at.r-project.org/src/contrib/ROracle_1.1-10.tar.gz'
Content type 'application/x-gzip' length 168193 bytes (164 Kb)
opened URL
downloaded 164 Kb

* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
ERROR: configuration failed for package 'ROracle'
* removing 'C:/Users/myaccount/Documents/R/win-library/3.0/ROracle'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-30~1.0/bin/i386/R" CMD INSTALL -l "C:\Users\myaccount\Documents\R\win-library\3.0" C:\Users\myaccount\AppData\Local\Temp\RtmpGggbyp/downloaded_packages/ROracle_1.1-10.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\myaccount\AppData\Local\Temp\RtmpGggbyp\downloaded_packages’

What should I do, how to proceed?

Misjudge answered 4/8, 2013 at 18:43 Comment(4)
I didn't have any trouble installing ROracle on windows 7. I've got both db and client 10g installed. Looks like you set the appropriate variables so try to install from the source and maybe we will get a more informative error message install.packages("ROracle",type = "source").Sherrell
Thanks, I also tried to install from source, but I got the same error message.Misjudge
can you fund some kind of log file or dump file in the folder ?Sherrell
No, I think it deletes these files, also recycle bin is empty.Misjudge
K
20

From http://jgilfillan.github.io/2016/05/28/how-to-install-roracle-in-windows-7/

Download binary from oracle: http://www.oracle.com/technetwork/database/database-technologies/r/roracle/downloads/index.html

The run the following command in r, substituting the file path:

setwd('xxxxx')   # set to path of download
install.packages('ROracle_1.2-1.zip', repos = NULL)

Then load the library and use the package - you may have to change XXXX to whatever is in your TNS Names:

library('ROracle')
drv <- dbDriver("Oracle")
con <- dbConnect(drv, "USER GOES HERE", "PASSWORD GOES HERE", dbname='XXX')

test connection:

dbReadTable(con, 'DUAL')

Note that this has also been confirmed to work on Windows 10.

Kip answered 19/8, 2015 at 4:19 Comment(2)
Has anyone had aby luck getting ROracle to work with R 3.5.0? Anyone have the inside scoop about whether Oracle has plans to update the package? TIABellicose
There's a version for 3.5 now, but installing it fails with "cannot open compressed file 'ROracle/DESCRIPTION', probable reason 'No such file or directory"Dropwort
C
11

I had this exact problem as well, including the OCI_INC error. They actually talk about it in the INSTALL file in the .tar.gz package, you can read more there.

You have to set the OCI_INC variable to the include directory like this:

set OCI_INC=C:\oracle\product\11.2.0\client_2\oci\include

Or whereever your file is. Here was my complete setup to get things installed from an Admin privileged command line.

set OCI_LIB64=C:\oracle\product\11.2.0\client_2\BIN
set OCI_INC=C:\oracle\product\11.2.0\client_2\oci\include
set PATH=C:\oracle\product\11.2.0\client_2\BIN;C:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;%PATH%
"C:/PROGRA~1/R/R-30~1.1/bin/x64/R" CMD INSTALL --build "C:/Your/Path/To/ROracle_1.1-10.tar.gz"

Also, make sure to change client_2 to client_1 and OCI_LIB64 to OCI_LIB32 if you are trying to do a 32-bit install.

Clupeoid answered 9/9, 2013 at 20:0 Comment(0)
F
4

After following the steps (highlighted in red boxes). I also ran commands below on R. enter image description here enter image description here So, everything went through well on a Windows 7 64-bit, R 3.4 64bit environment. enter image description here enter image description here

Sys.setenv(OCI_LIB64="C:/Oracle/instantclient_12_2/")
Sys.setenv(OCI_INC="C:/Oracle/product/11.2.0/client_1/oci/include")
install.packages("ROracle", dep=T)
Fellow answered 30/9, 2017 at 0:9 Comment(1)
Make sure Rtools is installed in base C directory. Like C:\RtoolsFellow
G
3

I had exactly this problem. It was caused because when installing RTools I did not check the 'edit PATH' checkbox. I uninstalled RTools and reinstalled it again, this time making sure the checkbox was checked, and it worked first time! Hope this helps.

Geronto answered 2/9, 2013 at 8:51 Comment(5)
Thanks, now it generates this error: Oracle Client Shared Library 32-bit - 11.2.0.1.0 Operating in Instant Client mode. ERROR: cannot find C:\app\myaccount\product\11.2.0\client_1/sdk/include or Oracle Client include. Please set OCI_INC to specify its location. ERROR: configuration failed for package 'ROracle'Misjudge
I don't have that kind of folder in my oracle client.Misjudge
I'm not really sure what to suggest - I'm running a full Oracle installation and not Instant Client, so I didn't come across this problem. Have you read the installation guide? cran.r-project.org/web/packages/ROracle/INSTALLGeronto
It says that: "If header files are not located in the sdk/include subdirectory of the Instant Client directory (the directory that contains the libraries), then set the OCI_INC environment variable to locate the header files." Where are these header files located in Instant client?Misjudge
I looked on the Oracle website (oracle.com/technetwork/topics/winsoft-085727.html) and it seems that there are different versions of instant client - one of them is called "Instant Client Package - SDK" which says that it contains header files. Perhaps try downloading that and see if the files are in there? Make sure you download for the correct version of Oracle.Geronto
N
2

I had a similar error when trying to install ROracle from source.1

After searching around a bit I had to undertake what others have mentioned as well as redownloading the tar.gz. When I double checked the download size it was 10KB instead of 234KB.

  1. Re-Download source from: http://cran.r-project.org/web/packages/ROracle/index.html
  2. Updated the following Environmental Varibles in windows

    SET PATH=C:\Rtools\bin;C:\Rtools\gcc-4.6.3;%PATH% SET OCI_INC=C:\Oracle_11G_ClientR2\product\11.2.0\client_1\oci\include SET OCI_LIB32=C:\Oracle_11G_ClientR2\product\11.2.0\client_1\BIN SET OCI_LIB64=C:\Oracle_11G_ClientR2\product\11.2.0\client_1\BIN R CMD INSTALL --build "C:\temp\ROracle_1.1-12.tar.gz"

  3. Output should look like the following: samplecmdoutput

1 Here is what the previous error looked like:

C:\Temp>R CMD INSTALL --build "C:\\temp\\ROracle_1.1-12.tar.gz" 
Error in getOctD(x, offset, len) : invalid octal digit
Norfolk answered 8/6, 2015 at 17:53 Comment(2)
The file ROracle_1.1-12.tar.gz contains instructions to compile source files, but it doesn't work well with Windows. The easier choice is to download the pre-compiled package from oracle.com/technetwork/database/database-technologies/r/roracle/…Greenebaum
The pre-compiled package is for x64 without i386/x32. To overcome this you must build from source under 32 bit. (Error: package ‘ROracle’ is not installed for 'arch = i386') community.oracle.com/thread/3551343Norfolk
B
0

Along with the 'Basic Package' and the 'ODBC Package', with Oracle 11g, you should copy unpacked files from the 'SDK package' into the subdirectory instantclient_11_2. In this case, you will not need to define the environment variable Sys.setenv (OCI_INC = "...").

Buoy answered 11/10, 2018 at 5:32 Comment(0)
H
-1

This is what worked for me:

Sys.setenv(OCI_LIB32="C:/oracle/product/12.1.0/client_1/BIN/")
Sys.setenv(OCI_INC="C:/oracle/product/12.1.0/client_1/oci/include/")
install.packages("ROracle")
Hispaniola answered 29/3, 2019 at 18:15 Comment(0)
A
-2
install.packages("P:/Strategic-Primary/documentation/R/Packages/DBI_1.0.0.zip", repos = NULL, type = "win.binary")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
package ‘DBI’ successfully unpacked and MD5 sums checked
> setwd('E:\R\packages')
Error: '\R' is an unrecognized escape in character string starting "'E:\R"
> setwd('E:\\R\\packages')
> install.packages('ROracle-1.3.2.zip')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘ROracle-1.3.2.zip’ is not available (for R version 3.6.0)
> install.packages('ROracle-1.3.1.zip')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘ROracle-1.3.1.zip’ is not available (for R version 3.6.0)
> Sys.setenv(OCI_LIB32="C:/oracle/product/12.1.0/client_1/BIN/")
> Sys.setenv(OCI_INC="C:/oracle/product/12.1.0/client_1/oci/include/")
> install.packages("ROracle")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’
  These will not be installed
> install.packages('ROracle-1.3.1.zip')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘ROracle-1.3.1.zip’ is not available (for R version 3.6.0)
> install.packages('ROracle-1.3.2.zip')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/xxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘ROracle-1.3.2.zip’ is not available (for R version 3.6.0)

I installed SDK, ODBC and basic install client (also set Env variable path) and it is still not working for me. Any advise pls?

Auroraauroral answered 18/12, 2019 at 15:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.