Re: Help/Advice installing cx_oracle on El Capitan

Kubo Takehiro <[email protected]> Wed, 21 Oct 2015 23:04:31 +0900
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAAkVAoS+ZOLqx=UZwroOnbnXwvjpqpB_J2oLL9ABA=bf_HM=dQ@mail.gmail.com>
On Wed, Oct 21, 2015 at 9:51 PM, greg <[email protected]> wrote:
>     ImportError:
> dlopen(/Users/me/sx_direct_env/lib/python2.7/site-packages/cx_Oracle.so,
> 2): Library not loaded: /b/227/rdbms/lib/libclntsh.dylib.10.1
>       Referenced from:
> /Users/me/sx_direct_env/lib/python2.7/site-packages/cx_Oracle.so
>       Reason: image not found

The cx_Oracle.so is linked with Oracle 10g instant client because it depends
on libclntsh.dylib.10.1.

>     $ export ORACLE_HOME=$PWD
>     $ export DYLD_LIBRARY_PATH=$ORACLE_HOME
>     $ export LD_LIBRARY_PATH=$ORACLE_HOME
>     $ export PATH=$PATH:$ORACLE_HOME

IMO, Oracle 10g client is in the $PATH before $ORACLE_HOME.
Could you swap the order as follows?

     $ export PATH=$ORACLE_HOME:$PATH

>     $ ruby -a fix_oralib.rb
>     adrci:
>        add rpath: @loader_path
>        change install name
>          from: /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1
>            to: @rpath/libclntsh.dylib.11.1

It uses relative path. Use -a option or --absolute-path option after
fix_oralib.rb as follows.

     $ ruby fix_oralib.rb -a

And then uninstall cx_oracle and reinstall it.

     $ pip uninstall cx_oracle
     $ pip install cx_oracle

------------------------------------------------------------------------------