Pythonスクリプトでのcx_Oracleのインポートは失敗します。
「pipinstallcx_oracle」を使用してcx_Oracleをインストールしました。これは正常に機能し、インストールされたと報告されています。
今私が試してみると:
import cx_Oracle
次のエラーが発生します
Traceback (most recent call last):
File "reader.py", line 9, in <module>
import cx_Oracle
ImportError: dlopen(/Library/Python/2.7/site-packages/cx_Oracle.so, 2): Symbol not found: _OCIAttrGet
Referenced from: /Library/Python/2.7/site-packages/cx_Oracle.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/cx_Oracle.so
その他の情報:
Pythonバージョン2.7/mac os 10.7.2(ライオン)
$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Oracle 10.2
$ sqlplus -version
SQL*Plus: Release 10.2.0.4.0 - Production
また、ORACLE_HOMEフォルダに/ binディレクトリがまったくなく、インスタントクライアントとSDKのみがインストールされています。
ox_Oracle
$ pip freeze
PyRSS2Gen==1.0.0
...
cx-Oracle==5.1.1
(cx_Oracleをインストールすることについて多くの質問が見つかりましたが、これについてはありません-ありがとう)