"DPI-1050: Oracle Client library is at version 10.2 but version 11.2 or higher is needed" Oracle 10g 与 Python 3.8 的连接问题

"DPI-1050: Oracle Client library is at version 10.2 but version 11.2 or higher is needed" Connection Problem with Oracle 10g with Python 3.8

我正在尝试在 Python 的帮助下连接 Oracle 10g 数据库 我正在按照网站上的这些说明进行操作: https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html
我正在使用
-Oracle 10g express edition 10.2 -Python 3.8.3 -Oracle Instant Client vs. 12.1 我也尝试过从 19.1 到 9.1

的其他版本的 oracle 即时客户端

我的 Python 脚本是:-

import cx_Oracle

con = cx_Oracle.connect('Shubho/Shubho@//localhost:1521/orcl')

print(con.version)
con.close()

但是在上面的脚本中我得到了这个错误:

cx_Oracle.DatabaseError: DPI-1050: Oracle Client library is at version 10.2 but version 11.2 or higher is needed

我将路径设置为: C:\Users\Anonymous\Desktop\instantclient-basic-nt-12.1.0.2.0\instantclient_12_1 C:\Users\Anonymous\AppData\Local\Programs\Python\Python38-32

您的机器以某种方式设置,因此首先加载 10.2 库。如果 PATH 真的没问题,请检查系统目录中可能存在的杂散 oci.dll 文件。

此外,还有 18c 版本的 Express Edition 可用。