環境
macOS
Python 3.7
Django 2.1
cx_Oracle 7.1
問題
在配置 settings.py 文件時候,執行 python manager.py
報錯:
cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded..."dlopen(libclntsh.dylib, 1): image not found". See https://oracle.github.io/odpi/doc/installation.html#macos for help
解決方法其實就在後面: https://oracle.github.io/odpi/doc/installation.html#macos for help
.
解決
打開URL: https://oracle.github.io/odpi/doc/installation.html#macos
找到macos的部分。
按照步驟執行。
注意: 我下載的 instantclient-basic-macos.x64-11.2.0.4.0.zip , 因此後面的步驟一定要按照11.2的步驟嚴格執行。
最後,重新啓動Django服務器,問題解決。