简体   繁体   English

64位cx_Oracle:DLL加载失败

[英]64-bit cx_Oracle: DLL load failed

Using Windows 2008 R2 Server. 使用Windows 2008 R2 Server。 Server was completely clean. 服务器完全干净。 Installed 64-bit Python 3.5, 64-bit Oracle Instant Client 12c. 安装了64位Python 3.5,64位Oracle Instant Client 12c。 pip installed cx_Oracle successfully. pip成功安装了cx_Oracle。 When I try to run a python script that imports cx_Oracle however, I get: 当我尝试运行导入cx_Oracle的python脚本时,我得到:

ImportError: DLL load failed: The specified module could not be found.

The instant client path is in the PATH environmental variable. 即时客户端路径位于PATH环境变量中。 I also made another system variable called ORACLE_HOME with the same instant client path. 我还使用相同的即时客户端路径创建了另一个名为ORACLE_HOME系统变量。

I've double checked everything is 64-bit, and looked through SO at the many other times this has come up, and no answer has helped. 我已经仔细检查过一切都是64位的,并且在其他许多时候看过这个问题,并且没有任何答案有所帮助。

First, the environment variable ORACLE_HOME should not be set when an instant client is used. 首先,使用即时客户端时不应设置环境变量ORACLE_HOME。 Setting it can have unintended side effects! 设置它可能会产生意想不到的副作用!

Second, if you used pip to install cx_Oracle that suggests you have a compiler and it succeeded in compiling the module. 其次,如果你使用pip来安装cx_Oracle,这表明你有一个编译器并且它成功编译了模块。 Check to make sure that it used the correct libraries. 检查以确保它使用了正确的库。

Third, you can also download and install a pre-built binary from the PyPI site and see if that helps matters any. 第三,您还可以从PyPI站点下载并安装预构建的二进制文件,看看是否有帮助。 Make sure you pick the Python 3.5, 64-bit, Oracle 12c version that is listed there. 确保选择那里列出的Python 3.5,64位Oracle 12c版本。 The PyPI site link is here: PyPI站点链接在这里:

https://pypi.python.org/pypi/cx_Oracle https://pypi.python.org/pypi/cx_Oracle

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

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