環境
macOS Big Sur(11.0.1)
serverless
Python3
問題発生
serverlessのプログラム実行中に以下が発生(長いので改行しています)。
cx_Oracle.clientversion()
cx_Oracle.DatabaseError: DPI-1047:
Cannot locate a 64-bit Oracle Client library:
"dlopen(libclntsh.dylib, 1): image not found". See
https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html
for help
64bitライブラリを入れてね、ということなので、上記URLに飛んで64bitのリソースがあるところに飛んでダウンロード。
2020/11/15時点では19系は19.9。
ダウンロードして、解凍して、指示通りにリンク……ファイルがない!
サイトの説明に書いてあるバージョン(19.3)にはあるので、それを使うのが良い。
19.9しか見当たらないけど、リンクを細工するとダウンロードできます。
-
Oracle Instant Client 19.9へのリンク
https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-basic-linux.x64-19.9.0.0.0dbru.zip -
Oracle Instant Client 19.3へのリンク(小細工)
https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip -
リンクする
ln -s /opt/oracle/instantclient_19_3/libclntsh.dylib ~/lib/