Python 连接到 Oracle 数据库错误 DPI-1047

标签 python oracle cx-oracle

我尝试连接我的 Oracle 数据库,但出现错误。我是 python 的初学者,我尝试在文档中找到答案,但这对我来说很难。

Python version :
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32

Oracle version :
11.2.0.1.0

我的鳕鱼很简单:

    from sqlalchemy import create_engine
    import cx_Oracle
    
    
    engine =  create_engine('oracle://user:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e79786949490889583a78f88c99493c989868a82" rel="noreferrer noopener nofollow">[email protected]</a>:port/SID')
    result = engine.execute('select * FROM TABLE')

结果我得到一个错误:

    Exception has occurred: DatabaseError
    (cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found".

最佳答案

Python cx_Oracle 库依赖于 Oracle 客户端库

从此处下载 Oracle 客户端库:https://www.oracle.com/database/technologies/instant-client.html

祝你好运!

关于Python 连接到 Oracle 数据库错误 DPI-1047,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63776650/

相关文章:

python - 使用 pandas 替换正则表达式格式化字符串内的日期

xml - Oracle Xml 生成节点 null

oracle - 数据库不可用时如何使sqlplus退出?

c++ - mysql-connector-c++ 8.0 连接被拒绝

python - 在 python 2.7.5 中使用来自 cx_Oracle 模块的函数 callproc 执行脚本

Python 迭代 cx_Oracle 结果集时出错

python - 在Python中分隔的Spark saveAsTextFile选项卡

python - 计算 Pandas 每一列的有效方法?

python - 使用 .contains() 从 DynamoDB 检索值

python - 使用 Python 从 SQL Server 和 Oracle 进行内连接查询