【问题标题】:cx_Oracle.DatabaseError: DPI-1047: 32-bit Oracle Client library cannot be loaded: "The specified module could not be foundcx_Oracle.DatabaseError:DPI-1047:无法加载 32 位 Oracle 客户端库:“找不到指定的模块
【发布时间】:2019-05-11 11:35:35
【问题描述】:

我正在尝试使用 pycharm IDE 中的 cx_oracle 连接 Oracle DB。 但是在执行以下代码时出现错误

编码:

import cx_Oracle
con = cx_Oracle.connect('#####/******@1#####/#####')
cur = con.cursor()
cur.execute('select * from gl_user')
for result in cur:
   print (result)
cur.close()
con.close()

cx_Oracle.DatabaseError 错误:DPI-1047 32 位 Oracle 客户端库不能是“找不到指定的模块”。请参阅https://oracle.github.io/odpi/doc/installation.html#windows 以获取帮助

【问题讨论】:

    标签: python-3.x


    【解决方案1】:

    关注 cx_Oracle installation guide。您需要安装 32 位 Oracle 客户端库 - 如 DPI-1047 错误所示。特别是,确保您正确设置了 PATH 以包含 Oracle 客户端库(您可能需要重新启动终端或程序,或者在最坏的情况下重新启动)。如果您使用的是 Oracle Instant Client,请确保您拥有所需的 VC Redistributable,如 download page 所示。

    【讨论】:

      猜你喜欢
      • 2018-06-06
      • 1970-01-01
      • 1970-01-01
      • 2019-09-13
      • 1970-01-01
      • 2019-10-10
      • 1970-01-01
      • 2019-01-06
      • 2019-12-06
      相关资源
      最近更新 更多