当前位置:Gxlcms > 数据库问题 > import cx_Oracle ImportError: DLL load failed: 找不到指定的模块。

import cx_Oracle ImportError: DLL load failed: 找不到指定的模块。

时间:2021-07-01 10:21:17 帮助过:90人阅读

我们知道,Python使用cx_Oracle连接oracle的两个步骤是:
1、先安装cx-Oracle包(我这里后来安装的是cx_Oracle-7.3.0版本).地址:http://cx-oracle.sourceforge.net/
2、下载Oracle客户端instantclient-basic-win64-12.rar(我的电脑是64位,12是版本,还有11、10等),解压后将oci.dll所在绝对路径添加到环境变量中。

运行代码出现异常:import cx_Oracle ImportError: DLL load failed: 找不到指定的模块。
百度解决方案:

  • 复制oci.dll到安装python的根目录下(我的:E:/python)
    注:网上很多人都说使用这种方法可以解决问题,但是我依然运行报错;
  • 卸载cx_Oracle-7.2.0,安装cx-Oracle 7.3.0,问题解决。

问题总结:
安装的cx-Oracle版本需要与instantclient版本适应。

import cx_Oracle ImportError: DLL load failed: 找不到指定的模块。

标签:适应   变量   python   dll   添加   网上   运行   for   http   

人气教程排行