本文介绍了cx_Oracle-DLL加载失败:%1不是有效的Win32应用程序. Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有:

  • 赢7(64位)
  • python 3.4
  • oracle 64位

此处下载并安装后,请尝试 cx_Oracle并尝试运行这段代码:

After I downloaded and installed from here the cx_Oracle and try to run this code:

import cx_Oracle as cx_Oracle
connection = cx_Oracle.connect("myuser/pass@myip:port/DBName")
SQL = "SELECT * FROM articles"
cursor = connection.cursor()
cursor.execute(SQL)
print(cursor)
cursor.close()
connection.close()

我遇到错误:

Traceback (most recent call last):
File "C:/dev/pyhton_ex_1/Calclist Test/connectToDB.py", line 18, in <module>
import cx_Oracle as cx_Oracle
ImportError: DLL load failed: %1 is not a valid Win32 application.

请帮助我,我试图在没有解决的情况下了解问题所在.

Please help me, I tried to understand what is the problem without solve yet.

推荐答案

请检查您的Oracle客户端是32位还是64位版本.如果您安装了32位版本的Oracle客户端,但是使用Python和64位模块,则会收到此错误.

please check your Oracle client is 32 or 64 bit version.you will get this error if you have Oracle client 32 bit version is installed, but Python, and modules are in 64 bit.

因此您可能需要安装64位版本的oracle客户端.

so you may need to install 64 bit version of oracle client.

这篇关于cx_Oracle-DLL加载失败:%1不是有效的Win32应用程序. Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:00