我尝试连接我的 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/