简体   繁体   English

安装 ROracle

[英]Installing ROracle

I have downloaded the compiled ROracle package from the Oracle website.我已经从 Oracle 网站下载了编译好的 ROracle 包。 I have set my working directory with setwd() .我已经用setwd()设置了我的工作目录。 Then I tried to install the package as follows:然后我尝试按如下方式安装软件包:

install.packages("ROracle-1.3.2.zip", repos=NULL)

It failed and I got the following error message:它失败了,我收到以下错误消息:

Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : 
  cannot open the connection
In addition: Warning message:
In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open compressed file 'ROracle-1.3.2/DESCRIPTION', probable reason 'No such file or directory'

I also tried from command line just in case:为了以防万一,我也从命令行尝试过:

R CMD INSTALL ROracle-1.3.2.zip

It also failed and I got the following error message:它也失败了,我收到以下错误消息:

* installing to library 'Z:/R/R-3.6.1/library'
Warning in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open compressed file 'ROracle-1.3.2/DESCRIPTION', probable reason 'No such file or directory'
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
  cannot open the connection

The DESCRIPTION file certainly exists in ROracle-1.3.2.zip.描述文件肯定存在于 ROracle-1.3.2.zip 中。 I opened it up and looked at - just a normal DESCRIPTION file.我打开它看了看——只是一个普通的描述文件。

I am using Windows 7.我正在使用 Windows 7。

How do I install ROracle?如何安装 ROracle?

You need to follow the following procedure:您需要遵循以下程序:

  1. Create a folder called "ROracle" and put the downloaded zip ROracle-1.3.2.zip in there创建一个名为“ROracle”的文件夹并将下载的 zip ROracle-1.3.2.zip 放在那里
  2. Unzip the .zip file in the folder.解压缩文件夹中的 .zip 文件。 Now you have all the contents of the zip file (including the original zip file) in the ROracle folder that you created in step 1现在,您在步骤 1 中创建的 ROracle 文件夹中拥有 zip 文件(包括原始 zip 文件)的所有内容
  3. Remove the original .zip file from the folder.从文件夹中删除原始 .zip 文件。 Now the folder "ROracle" you created in step 1 only contains the contents of the original .zip file现在,您在步骤 1 中创建的文件夹“ROracle”仅包含原始 .zip 文件的内容
  4. Add the "ROracle" folder to a zip file called "ROracle.zip"将“ROracle”文件夹添加到名为“ROracle.zip”的压缩文件中

Got down into this solution by comparing hierarchy of earlier ROracle_1.3-1.zip -file which i got working well in earlier R version.通过比较我在早期 R 版本中运行良好的早期 ROracle_1.3-1.zip 文件的层次结构,深入研究了这个解决方案。

After following all these steps the outcome is that the DESCRIPTION file can be found in ROracle.zip/ROracle/DESCRIPTION instead of ROracle-1.3.2.zip/DESCRIPTION执行完所有这些步骤后,结果是可以在ROracle.zip/ROracle/DESCRIPTION而不是ROracle-1.3.2.zip/DESCRIPTION找到描述文件

With the newly zip-file from step 4 the installation is a quite straightforward.使用第 4 步中的新 zip 文件,安装非常简单。

setwd("THEPLACEWHERETHE ROracle.zip file is located)
install.packages('ROracle.zip', repos = NULL)

My .Renviron contains these lines if that matters如果重要的话,我的.Renviron包含这些行

    # PATH="C:/Rtools/bin;C:/oracle/instantclient_19_5;$PATH"
    # OCI_LIB64 = C:/oracle/instantclient_19_5
    # BINPREF="C:/Rtools/mingw_$(WIN)/bin/"

OS is WIN10.操作系统是WIN10。 R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night" Platform: x86_64-w64-mingw32/x64 (64-bit) ROracle 1.3-2 R version 3.6.2 (2019-12-12) -- 《黑夜暴风雨》平台:x86_64-w64-mingw32/x64(64位)ROracle 1.3-2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM