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

问题描述 投票:0回答:1

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

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

  1. 我有python 3.8 64位
  2. 我有 Windows Server 2019 64 位
  3. 我下载了版本12.1.0.2.0 64位oracle即时客户端。尝试使用即时客户端包 - 基本和即时客户端包 - 基本 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
python cx-oracle
1个回答
0
投票

扩展一些评论:

  • 请向我们提供更多详细信息,以便我们知道您想要做什么。特别是您的数据库是远程的还是在同一台计算机上?这将决定您是否需要即时客户端

  • 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 脚本中调用它。用法已在文档中显示。

© www.soinside.com 2019 - 2024. All rights reserved.