Python – cx_Oracle throws missing libclntsh.so.11.1 when executed by django-chronograph

I have setup the cx_Oracle and i could query the data thru the custom django-admin command.

 

But when i try to schedule the custom command using django-chronograph. It throws the following error.

Traceback (most recent call last):
  File "query.py", line 7, in ?
    import cx_Oracle
ImportError: libclntsh.so.11.1: cannot open shared object file: No such file or directory

 

After spending a whole afternoon checking the root cause. I found that the django-chronograph fails to read those required libs inside $ORACLE_HOME/lib. I have tried to move the $ORACLE_HOME and $LD_LIBRARY_PATH declaration from profile.d (Valid for interactive shell only) to .bashrc. But still no luck.

Finally, i have to create some symbolic links to resolve the problem.

/usr/lib64/libclntsh.so.11.1 -> /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
/usr/lib64/libnnz11.so       -> /usr/lib/oracle/11.2/client64/lib/libnnz11.so
/usr/lib64/libocci.so.11.1   -> /usr/lib/oracle/11.2/client64/lib/libocci.so.11.1
/usr/lib64/libociei.so       -> /usr/lib/oracle/11.2/client64/lib/libociei.so
/usr/lib64/libsqlplusic.so   -> /usr/lib/oracle/11.2/client64/lib/libsqlplusic.so
/usr/lib64/libsqlplus.so     -> /usr/lib/oracle/11.2/client64/lib/libsqlplus.so

 

Not a elegant solution. Please let me know if u have a better idea.

Done =)

Reference: [cx-oracle-users] CentOS 5, Oracle 11g RPM Binary install – libclntsh.so.11.1:

One thought on “Python – cx_Oracle throws missing libclntsh.so.11.1 when executed by django-chronograph”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.