cx_Oracle ImportError: DLL load failed: %1 不是有效的 Win32 应用程序

来源:互联网 发布:ubuntu 安装gcc g 编辑:程序博客网 时间:2024/05/24 22:43

cx_Oracle ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。

 

环境:

Win7 64位

Python2.7.2 64位

Oracle client 32位

 

cx_Oracle: Windows amd64 Installer (Oracle 11g, Python 2.7)

 

在python终端报错:

Python代码  收藏代码
  1. >>> import cx_Oracle  
  2. Traceback (most recent call last):  
  3.   File "<stdin>", line 1in <module>  
  4. ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。  
 

原因:

在64位系统上安装32位Oracle client,是因为要安装PLSQL Developer,但是货认不了64位的Oracle Client。所以现在导致现在的cx_Oralce认不到oci.dll的32位版本。

 

解决方法:

1.安装64位的oracle client

2.拷贝一个64位的 oci.dll 到%python_home%\Lib\site-packages 下

0 0