ROracle在R Studio中不起作用 [英] ROracle not working in R studio
问题描述
我正在尝试在unix盒子上安装ROracle软件包. 该软件包已正确安装.但是库(ROracle)不能正常工作并显示错误
I'm trying to install ROracle package on a unix box. The package gets installed properly. But library(ROracle) does not work fine with the error
library(ROracle)
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/u01/group1/home/oracle/R/x86_64-redhat-linux-gnu-library/3.1/ROracle/libs/ROracle.so':
libclntsh.so.11.1: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘ROracle’
该软件包可从命令行正常安装,但在R Studio中不起作用.我在论坛上浏览了很多线程,其中很多建议导出LD_LIBRARY_PATH并将其重置.事实上,我继续将所有R系统变量从命令行复制到R Studio中. 但这仍然行不通.
The package installs fine from the command line , but just does not work in R studio. I went through lot of threads in forum and lot of them suggested to export the LD_LIBRARY_PATH and reset it.infact i went ahead and copied all the R system variables from command line into R Studio. But it still does not work out fine.
我还注意到的一件事是,每次重新启动R studio时,R系统变量都会更改.可能是R studio无法正确获取路径值的问题.
One thing i have also noticed is that the R system variables change every time i restart R studio. Can it be the problem that R studio is not taking path values correctly.
推荐答案
似乎问题是由未在系统范围内设置$ LD_LIBRARY_PATH环境变量引起的.与其他环境变量不同, $ LD_LIBRARY_PATH需要特殊处理(请参见 Ubuntu帮助页面并搜索 ld.so.conf.d )
Seems that the problem is caused by the $LD_LIBRARY_PATH environment variable not being set in a way that is system-wide. Unlike other environment variables, $LD_LIBRARY_PATH needs special treatment (see the Ubuntu Help page and search for ld.so.conf.d)
我能够通过根据评论设置$ LD_LIBRARY_PATH来解决此问题15 :
echo "/usr/lib/oracle/11.2/client64/lib" | sudo tee /etc/ld.so.conf.d/oracle.conf
将echo语句更改为Oracle Instant Client库的存储位置. (可以通过运行echo $OCI_LIB
找到我的.
Change the echo statement to where your Oracle Instant Client libraries are stored. (Mine could be found by running echo $OCI_LIB
.
然后更新缓存:
sudo ldconfig -v
然后打开RStudio,执行library("ROracle")
,它应该可以工作.
Then open RStudio, execute library("ROracle")
and it should work.
这篇关于ROracle在R Studio中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!