簡體   English   中英

將 Pycharm 與 Oracle SQL 數據庫連接? - 錯誤:DPI-1047

[英]Connecting Pycharm with an Oracle SQL Database? - Error: DPI-1047

我想將 PyCharm 與遠程計算機上的 Oracle SQL 數據庫連接。 我已經安裝了 cx_Oracle 8.0 版並遵循以下教程: https : //www.oracletutorial.com/python-oracle/connecting-to-oracle-database-in-python/

直到我收到以下錯誤為止:“DPI-1047:”無法找到 32 位 Oracle 客戶端庫:“C:...\\product\\18.0.0\\dbhomeXE\\bin\\oci.dll 不是正確的架構”。 請參閱https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html尋求幫助”

我按照錯誤中的鏈接進行操作,由於我的數據庫位於遠程計算機上,因此我下載了“Oracle Instant Client “Basic””。 我解壓縮了 Instant Client,但安裝它似乎有問題。

我遵循了本教程,並閱讀了所有其他帖子,但它們並沒有真正幫助我。

http://www.interfaceware.com/manual/oracle_instant_client.html

有人可以告訴我我缺少什么嗎?

我將永遠感激不盡。

問題解決了:

我使用本教程進行了設置:

http://www.interfaceware.com/manual/oracle_instant_client.html

我用它來設置 Oracle 客戶端目錄:

https://cx-oracle.readthedocs.io/en/latest/user_guide/initialization.html#using-cx-oracle-init-oracle-client-to-set-the-oracle-client-directory

import cx_Oracle
import sys

try:
    cx_Oracle.init_oracle_client(lib_dir=r"C:\oracle\instantclient_19_6")
except Exception as err:
    print("Whoops!")
    print(err);
    sys.exit(1);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM