DPI-1047:Cannot locate a 64-bit Oracle Client library:The specified module could not be found.

系統環境Windows10
Python版本:3.6
Oracle版本12.2

最近在使用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、**解壓之後,配置系統環境。
這是個栗子?:
解壓後路徑:D:\software\instantclient_12_2
將此路徑添加到系統的Path中
**3、**在解壓路徑中添加tnsnames.ora文件,文件配置如下:
這是個栗子?:

orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 服務器IP)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = 服務器上服務名稱)
    )
  )

至此萬事大吉!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章