InterfaceError:无法获取Oracle环境句柄; ORACLE_HOME是正确的,SQL * Plus将连接 [英] InterfaceError: Unable to acquire Oracle environment handle; ORACLE_HOME is correct and SQL*Plus will connect
问题描述
尝试导入cx_Oracle时,出现标准的"DLL加载失败;找不到模块"错误.我安装了正确的即时客户端,路径都正确...运行Dependency Walker告诉我我缺少以下.dll的 MSVCR90,GPSVC,IESHIMS.
I'm getting the standard "DLL load failed; module not found" error when trying to import cx_Oracle. I have the proper instant client installed, the paths are all correct... running Dependency Walker tells me I'm missing the following .dll's MSVCR90, GPSVC, IESHIMS.
我正在运行Oracle 11g和Python 2.7的即时客户端.有人有想法么?我发现的大多数答案都包含错误的路径,但事实并非如此……此外,我在系统上其他任何地方都找不到这些.dll.
I'm running the instant client for Oracle 11g and Python 2.7. Anyone have any ideas? Most of the answers I have found entail an incorrect path, but that doesn't seem to be the case... additionally, I can't find any of those .dll's anywhere else on my system.
我最终安装了Oracle XE 11g(32位). Python 2.7和cx_Oracle都是32位的(我还要补充一点,我在Windows上). cx_Oracle现在可以干净地安装;但是,在连接后,我收到一个错误:
I ended up installing Oracle XE 11g (32 bit); both Python 2.7 and the cx_Oracle are also 32 bit (I should also add that I'm on Windows). cx_Oracle now installs cleanly; however upon connection I receive an error:
InterfaceError: Unable to acquire Oracle environment handle
ORACLE_HOME路径正确无误,PATH文件夹中的bin也是如此...
The ORACLE_HOME path is correct, as is the bin in the PATH folder...
推荐答案
我遇到了同样的问题:您必须设置变量ORACLE_HOME
来匹配您的Oracle客户端文件夹(在Unix上:例如,通过shell;在Windows:如果在配置面板的环境变量中不存在新变量,则创建一个新变量),因为这是cx_Oracle
模块可以链接到它的方式.
I had the same issue: you have to set the variable ORACLE_HOME
to match your Oracle client folder (on Unix: via a shell, for instance; on Windows: create a new variable if it does not exist in the Environment variables of the Configuration Panel) since this is the way the cx_Oracle
module can link to it.
您的文件夹$ORACLE_HOME/network/admin
(在Windows中为%ORACLE_HOME%\network\admin
)是您的tnsnames.ora
文件应存在的位置.
Your folder $ORACLE_HOME/network/admin
(%ORACLE_HOME%\network\admin
on Windows) is the place where your tnsnames.ora
file should exist.
这篇关于InterfaceError:无法获取Oracle环境句柄; ORACLE_HOME是正确的,SQL * Plus将连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!