我正试图用Python连接Oracle 10g数据库,我按照网站上的这些说明进行操作。https:/cx-oracle.readthedocs.ioenlatestuser_guideinstallation.html。 我使用的是 -Oracle 10g express edition 10.2
-Python 3.8.3
-Oracle Instant Client vs. 12.1
我也试过用其他版本的oracle即时客户端,从19.1到9.1。
我的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真的没问题,请检查系统目录中是否有杂散的occi.dll文件。
另外,还有一个18c版本的Express Edition可用。