cx_Oracle 5.0.4 + Python 3.1.2 + Oracle Instant Client 10.2.04; DLL Load failed on import (Win/NT)

Hans Mulder hansmu at xs4all.nl
Fri Aug 13 15:14:40 EDT 2010


tormod wrote:
> On Aug 12, 12:30 pm, Alexander Gattin <xr... at yandex.ru> wrote:
>> Does Windows have anything like LD_LIBRARY_PATH/SHLIB_PATH?

Yes and no.  Windows uses PATH both for finding execuables and for
finding DLLs.  So if there's a DLL Windows cannot find, you need to
add the folder containing that DLL to your PATH variable.

> No, isn't that only if I have an actual Oracle client installed (not
> the instant client)?

Whether you use the instant client or an actual Oracle client is not
the issue.  You may or may not need LD_LIBRARY_PATH either way.

When you import cx_Oracle on Linux, it loads a file named cx_Oracle.so
which in turn loads two files named libclntsh.so and libnnz10.so.
These two files are part of the Oracle client installation.  The dynamic
loader has a list of directories where it tries to find these files;
if they aren't there, then the import of cx_Oracle will fail.  In that
case, you need to set LD_LIBRARY_PATH to the directory containing them
(or talk your sysadmin into adding this directory to the default path.
He'd do that by adding the directory to /etc/ld.so.conf and running
ldconfig).

Hope this helps,

-- HansM





More information about the Python-list mailing list