当 Python 和 Oracle 都是 64 位时,为什么 cx_Oracle 给出不正确的体系结构错误?

Why is cx_Oracle giving incorrect architecture error when both Python and Oracle are 64-bit?

我正在尝试使用 Python 中的 cx_Oracle 连接到我的数据库。我遇到以下错误:

DPI-1047:无法加载 64 位 Oracle 客户端库:"C:\oracle\product\V11.2.0.10\bin\oci.dll is not the correct architecture"

在我看来 Python 和 Oracle 都是 64 位安装。规格如下:

Python 3.6.1 |蟒蛇 4.4.0(64 位)

Oracle 数据库 11g 企业版 11.2.04.0 版 - 64 位生产

从 Sysinternals 下载 Sigcheck 并检查架构:

c:\>sigcheck c:\oracle\product.1\Client_x64\bin\oci.dll

Sigcheck v2.60 - File version and signature viewer
Copyright (C) 2004-2017 Mark Russinovich
Sysinternals - www.sysinternals.com

c:\oracle\product.1\client_x64\bin\oci.dll:
        Verified:       Unsigned
        Link date:      09:49 11.09.2014
        Publisher:      n/a
        Company:        Oracle Corporation
        Description:    Oracle Call Interface
        Product:        n/a
        Prod version:   n/a
        File version:   12.1.0.0.0 Production
        MachineType:    64-bit

c:\>

对您的 Python 二进制文件执行相同的操作。