本文介绍了ROracle 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在我的计算机上运行 ROracle 包.我有 Windows 10 和 R 3.5.1(它适用于 Windows 7).第一次尝试:

I am having trouble getting the ROracle package to run on my computer. I have windows 10 and R 3.5.1 (it worked on windows 7).First Attempt:

install.packages("ROracle")
Installing package into 
‘C:/Users/Documents/R/win-library/3.5’
(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

我是按照这里的说明直接从Oracle下载的如何在 Windows 7 上安装 ROracle 包?

I followed the instructions here and downloaded it from Oracle directlyHow to install ROracle package on Windows 7?

我也查看了这些网站,但这些建议也不起作用.如何安装 ROracle 包?

I also looked at these sites, but the suggestions don’t work their either.How to install ROracle package?

ROracle 安装 :: 无法加载共享对象错误

如何安装r包适用于 Windows 10 64 位上的 oracle

setwd("C:\\Users\\Downloads")
install.packages('ROracle_1.3-1.zip', repos = NULL)
Installing package into ‘C:/Users/Documents/R/win-library/3.5’
   (as ‘lib’ is unspecified)
   package ‘ROracle’ successfully unpacked and MD5 sums checked

library(ROracle)
Error: package or namespace load failed for ‘ROracle’:
package ‘ROracle’ was installed by an R version with different internals; it 
needs to be reinstalled for use with this R version

我的机器上有 mysql 和 sqldeveloper.任何帮助,将不胜感激.

I have mysql and sqldeveloper on my machine. Any help would be appreciated.

推荐答案

下载兼容版本的 ROracle、Instant Client &R

最新版本的 RTools 可从以下链接下载

Download compatible versions of ROracle, Instant Client & R

LATEST version of RTools can be downloaded from link below

重要链接:Instant Client 版本 (12.2):下载 Instant Client 的基本版和 sdk 版http://www.oracle.com/technetwork/database/features/instant-客户端/

Important links:Instant Client Version (12.2): Download the basic as well sdk version of instant client http://www.oracle.com/technetwork/database/features/instant-client/

R for Windows(查找 R for Windows 的以前版本)https://cran.rstudio.com/bin/windows/base/old/https://cran.rstudio.com/bin/windows/base/old/3.6.1/R-3.6.1-win.exe

RTools (RTools35)https://cran.r-project.org/bin/windows/Rtools/

RTools (RTools35) https://cran.r-project.org/bin/windows/Rtools/

ROracle(ROracle-1.3.2 兼容 R3.6.0 及以上版本)https://www.oracle.com/database/technologies/roracle-downloads.htmlROracle 故障排除非常重要的链接:https://cran.cnr.berkeley.edu/web/packages/ROracle/INSTALL

ROracle (ROracle-1.3.2 is compatible with R3.6.0 version and above) https://www.oracle.com/database/technologies/roracle-downloads.html Very important link for Troubleshooting ROracle: https://cran.cnr.berkeley.edu/web/packages/ROracle/INSTALL

RStudio

在控制面板>系统&中设置以下环境变量安全>系统>高级系统设置>在系统属性中,点击环境变量">在系统变量中设置:

Set the below environment variables in control Panel > System & Security > System> Advanced System Settings> In System properties, click on "Environment Variables"> In system variables SET BELOW:

ORACLE_HOME = 'C:/oreclient_install_dir/instantclient_12_2'
OCI_INC     = 'C:/oreclient_install_dir/instantclient_12_2/sdk/include'
OCI_LIB64   = 'C:/oreclient_install_dir/instantclient_12_2'
TNS_ADMIN   = 'C:/oreclient_install_dir/instantclient_12_2'

请参阅我已经安装了 64 位版本的 R,因此设置了相同的环境变量.如果您使用的是 32 位版本,请将 OCI_LIB32 设置为适当的路径.另外,将 TNS 文件放在适当的位置.

Please see I have installed 64-bit version of R and hence setting environment variables for the same. If you are using 32-bit version, please set OCI_LIB32 with appropriate path. Also, place the TNS file at the appropriate location.

另外,设置路径以包含:

Also, set path to include:

C:\oreclient_install_dir\instantclient_12_2 <br/>
C:\app\client\pc_username\product\12.2.0\client_1  
C:\app\client\pc_username\product\12.2.0\client_1\bin  
C:\app\client\pc_username\product\12.2.0\client_1\Network\Admin  
%PATH%
C:\R\R-3.6.0\bin  
C:\R\Rtools\bin  
C:\R\Rtools\mingw_64\bin  

几个重要的R命令来检查变量集:

R.home(component = "home")
Sys.getenv("PATH")
Sys.getenv("OCI_INC")
Sys.getenv("OCI_LIB64")
Sys.getenv("ORACLE_HOME")
Sys.getenv("TNS_ADMIN")

设置env变量后请重启R,运行ROracle命令时建议以管理员身份运行R.

Please re-start R when the env variables are set and it is recommended to run R as administrator when running ROracle commands.

install.packages("C:/ROracle/ROracle_1.3-2.tar.gz", repos = NULL)

您可能还需要安装 DBI 包

you may need to install DBI package as well

install.packages("DBI")
library("DBI")
library("ROracle")

这篇关于ROracle 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 07:06