【轉】Python訪問oracle數據庫,DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found"


 

使用python連接Oracle,出現如下錯誤:

DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help

 

解決方案:
**1、**需要安裝Oracle Instant Client(安裝與服務器端Oracle版本相近的版本)
安裝包下載地址:https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
**2、**解壓之后,配置系統環境。
這是個栗子:
解壓后路徑:C:\software\oracle\instantclient_12_2
將此路徑添加到系統的Path中
**3、**在解壓路徑中添加tnsnames.ora文件,文件配置如下:
這是個栗子:

orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = IP地址)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = 服務名)
    )
  )

over

 

轉自:https://blog.csdn.net/u014487025/article/details/88538217

 

親測可行,已成功!

 

謝謝

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM