mod_python load cx_Oracle error
Mladen Gogala
no at email.here.invalid
Mon Jul 19 14:08:00 EDT 2010
On Mon, 19 Jul 2010 09:12:20 -0700, li wang wrote:
> 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 at 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.
>>> import cx_Oracle
>>>
And this is what happens when I unset the shell variable:
mgogala at nycwxp2622:~$ unset LD_LIBRARY_PATH
mgogala at 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.
>>>
>>> import cx_Oracle
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.
--
http://mgogala.byethost5.com
More information about the Python-list
mailing list