得到"cx_Oracle.DatabaseError:DPI-1050:Oracle客户端库必须为11.2或更高版本".错误

问题描述:

我正在尝试使用以下代码使用 pycharm(3.3)访问我的 Oracle SQL(11.2.0),但是在以下详细信息中出现错误.

I am trying to use pycharm(3.3) to access my Oracle SQL(11.2.0) using the below codes but getting error with below details.

使用的代码:

import cx_Oracle

connection = cx_Oracle.connect('uname/pwd@14@server')

收到错误

cx_Oracle.DatabaseError: DPI-1050: Oracle Client library must be at version 11.2 or higher

我遇到了一个与您非常相似的问题.我可以通过使用其他连接方法来解决它:

I had an issue very similar to yours. I was able to solve it by using a different connection method:

my_dsn = cx_Oracle.makedsn("host",port,sid="sid")
connection = cx_Oracle.connect(user="user", password="password", dsn=my_dsn)
cursor = connection.cursor()

querystring = "SQL query"
cursor.execute(querystring)

请参见 http://cx-oracle.readthedocs.io/en/最新的/module.html 以获取更多信息