1

I have installed cx_oracle(python3) and instant client 21_1 inside a container. When I try to first time I got this error

Cannot locate a 64-bit Oracle Client library: "/python- 
env/instantclient_21_1/lib/libclntsh.so:

So I have created lib under /python-env/instantclient_21_1/ and tried again, now I'm getting this error

cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libnnz19.so: cannot open shared object file: No such file or directory". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help

I don't understand where is it searching for the that so file. It is already present in /python- env/instantclient_21_1/lib/

Please help

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
  • 1
    Is that location in `LD_LIBRARY_PATH`? Does running `ldd` against the library (to see what other libraries it depends on in turn) give you another error that would point to root cause? – Charles Duffy Apr 15 '21 at 16:47
  • Running ldd return all the list, it seems all dependencies resolved – Mammu yedukondalu Apr 15 '21 at 16:53
  • That's encouraging. And does setting `LDD_LIBRARY_PATH` to include the directory (`export LDD_LIBRARY_PATH=/python-env/instantclient_21_1/lib`) change anything? – Charles Duffy Apr 15 '21 at 17:07

1 Answers1

1

Follow the Instant Client installation steps or cx_Oracle Installation steps and use ldconfig to set the library path to include the Instant Client directory.

You could set DPI_DEBUG_LEVEL=64 (see here) to trace how cx_Oracle is looking for the libraries.

Also see Docker for Oracle Database Applications in Node.js and Python.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48