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:

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s