使用python鏈接Oracle,出現以下錯誤:html
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
解決方案:
**一、**須要安裝Oracle Instant Client(安裝與服務器端Oracle版本相近的版本)
安裝包下載地址:https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
**二、**解壓以後,配置系統環境。
這是個栗子:
解壓後路徑:C:\software\oracle\instantclient_12_2
將此路徑添加到系統的Path中
**三、**在解壓路徑中添加tnsnames.ora文件,文件配置以下:
這是個栗子:
python
orcl = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = IP地址)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = 服務名) ) )
overgit
轉自:https://blog.csdn.net/u014487025/article/details/88538217github
親測可行,已成功!windows
謝謝服務器