mod_python load cx_Oracle error

L

li wang

It's quite weird when I import cx_Oracle in python interactive shell,
it works perfectly.
but when I import cx_Oracle in a *,py script, handled by
mod_python.publisher, it keep reportint :

ImportError: libclntsh.so.10.1: cannot open shared object file: No
such file or directory

Can I anyone have a clue what's the matter,
any help would be appreciated!
 
M

Mladen Gogala

It's quite weird when I import cx_Oracle in python interactive shell, it
works perfectly.
but when I import cx_Oracle in a *,py script, handled by
mod_python.publisher, it keep reportint :

ImportError: libclntsh.so.10.1: cannot open shared object file: No such
file or directory

Can I anyone have a clue what's the matter, any help would be
appreciated!


That's an Oracle error, it means that you didn't set and export
LD_LIBRARY_PATH like this:

export LD_LIBRARY_PATH=$ORACLE_HOME/lib


This is how it normally works:
mgogala@nycwxp2622:~$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And this is what happens when I unset the shell variable:
mgogala@nycwxp2622:~$ unset LD_LIBRARY_PATH
mgogala@nycwxp2622:~$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libclntsh.so.11.1: cannot open shared object file: No such
file or directory

My cx_Oracle is linked against Oracle instant client 11.2 on Ubuntu.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top