How to install ROracle package on Windows 7?(如何在 Windows 7 上安装 ROracle 包?)
问题描述
我正在尝试在我的 Windows 7 客户端上安装 ROracle 包.我安装了 Oracle Instant 客户端和 Rtools,安装了 DBI 包,设置了 OCI32_LIB 环境变量.但是当我尝试从命令行安装时:
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:UsersmyaccountDocumentsRwin-library3.0" C:UsersmyaccountAppDataLocalTempRtmpGggbyp/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:UsersmyaccountAppDataLocalTempRtmpGggbypdownloaded_packages’
我该怎么办,如何进行?
What should I do, how to proceed?
推荐答案
来自 http://jgilfillan.github.io/2016/05/28/how-to-install-roracle-in-windows-7/
从oracle下载二进制文件:http://www.oracle.com/technetwork/database/database-technologies/r/roracle/downloads/index.html
Download binary from oracle: http://www.oracle.com/technetwork/database/database-technologies/r/roracle/downloads/index.html
在r中运行以下命令,替换文件路径:
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)
然后加载库并使用包 - 您可能需要将 XXXX 更改为 TNS 名称中的任何内容:
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')
测试连接:
dbReadTable(con, 'DUAL')
请注意,这也已确认适用于 Windows 10.
Note that this has also been confirmed to work on Windows 10.
这篇关于如何在 Windows 7 上安装 ROracle 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Windows 7 上安装 ROracle 包?
基础教程推荐
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01