osx - cx oracle ImportError -
i followed this tutorial installing cx_oracle on mac. after tweaks successful. using mavericks earlier. got upgrade el capitan. that's disaster came in.
it stopped working. couldn't find related files in directory earlier. due system integrity protection, go through whole process again , installed @ usr/local/lib/share/oracle/installclient_11_2
.
but when run program. throws error message:
importerror: dlopen(/library/python/2.7/site-packages/cx_oracle.so, 2): library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 referenced from: /library/python/2.7/site-packages/cx_oracle.so reason: image not found
i tried lot of solutions online, https://gist.github.com/rmoff/5a70862f27d2284e9541, http://kevindalias.com/2014/03/26/how-to-set-up-cx_oracle-for-python-on-mac-os-x-10-89/
still no luck on me:(
any suggestions welcome. in advance!
==========================================================================
update:
found this post online, works magically on el capitan. delete old install, start fresh following intruction step-by-step.
this related system integrity protection (sip) changes in el capitan, among other things prevents dyld_library_path being inherited spawned processes.
you can modify cx_oracle.so
library use actual path oracle client library instead of searched path no longer works; make sure have oracle_home
still set point actual instant client location, , note exact path reported importerror
should used - 3071542110
value may vary depending on version/build of instant client have installed:
export oracle_home=/usr/local/lib/share/oracle/installclient_11_2 install_name_tool -change \ /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 \ $oracle_home/libclntsh.dylib.11.1 \ /library/python/2.7/site-packages/cx_oracle.so
... library can't find oracle one:
importerror: dlopen(/library/python/2.7/site-packages/cx_oracle.so, 2): library not loaded: /ade/b/3071542110/oracle/ldap/lib/libnnz11.dylib referenced from: /usr/local/lib/share/oracle/installclient_11_2/libclntsh.dylib.11.1 reason: image not found
so you'd need change library too, may less comfortable with:
install_name_tool -change \ /ade/b/3071542110/oracle/ldap/lib/libnnz11.dylib \ $oracle_home/libnnz11.dylib \ $oracle_home/libclntsh.dylib.11.1
depending on exact client version/build may need make file writable before running command, with:
chmod 755 $oracle_home/libclntsh.dylib.11.1
with changes can run cx_oracle
tests on el capitan.
more on install_name_change
here.
it looks 12c instant client has been built in way avoids issue, upgrading gong simpler hacking around int 11g files.
Comments
Post a Comment