DPI-1047:无法找到64位Oracle客户端库:“找不到指定的模块”-不可重复

时间:2020-07-04 10:12:01

标签: python cx-oracle

我尝试遵循Stack溢出的所有可能答案,并尝试遵循与官方文档中所述完全相同的步骤。

https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html

  1. 我有python 3.8 64bit
  2. 我有Windows Server 2019 64位
  3. 我下载了版本12.1.0.2.0 64位oracle即时客户端。尝试使用Instant Client Package-Basic和Instant Client Package-Basic Light
  4. 将下载文件的路径设置为环境变量Path
  5. 重新启动系统。
import cx_Oracle

dsn_tns = cx_Oracle.makedsn('XXX', 'PORT', service_name='XXX') 
conn = cx_Oracle.connect(user=r'XXX', password='XXX', dsn=dsn_tns)


c = conn.cursor()
c.execute(r'select name,open_mode from v$database;') 
print(c)
conn.close()

我不知道该怎么办。仍然收到以下错误:

cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help

1 个答案:

答案 0 :(得分:0)

展开一些评论:

  • 给我们更多详细信息,以便我们知道您要做什么。特别是您的数据库是远程的还是在同一台计算机上?这将确定您是否需要Instant Client

  • Windows的安装说明为https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html#installing-cx-oracle-on-windows

  • 使用Instant Client 19.6,因为它可以连接到Instant Client 12可以连接的相同数据库版本范围。但是它具有更多的功能和修复程序。

  • 确保已安装正确的Windows VS可再发行组件。这是一个普遍的问题。

  • 取决于设置PATH的方式,您可能需要重新启动终端窗口以获取更新的值。向我们展示您将PATH设置为什么。请注意,在Windws上使用cx_Oracle 8时,可以使用init_oracle_client()来代替设置PATH,但是需要在每个python脚本中调用它。用法显示在文档中。

相关问题