Python oracle ImportError: DLL load failed: 找不到指定的程序 or dll load failed 不是有效的 win32 应用程序。

安装cx_Oracle的步骤:
1. 查看自己的oracle的版本和位数,如我的是 11g,64bits我的python是2.7版本的,就需要下载这个
2. Python oracle ImportError: DLL load failed: 找不到指定的程序 or dll load failed 不是有效的 win32 应用程序。_第1张图片

  1. 双击进行安装
  2. 可能会报错 ImportError: DLL load failed: 找不到指定的程序
  3. 需要到oracle下载instant client (一定要下载对应位数的Instant Client (你的电脑的bits)
  4. 下载后instantclient-basic-windows.x64-12.1.0.2.0.zip 解压,将其中的oci.dll文件复制到python安装目录的Lib\site-packages下,如 C:\Python27\Lib\site-packages
  5. 打开 python命令行,输入import cx_Oracle没有报错说明成功了

问题:
1. ImportError: DLL load failed: 找不到指定的程序 :需要下载instant client 来copy oci.dll
2. dll load failed 不是有效的 win32 应用程序:instanet client 的oci.dll版本不对,之前我用的是32为的,换了64为的就没有这个错误了

你可能感兴趣的:(oracle,python)