1. What versions are you using?
instant_client_version: tested on 21 and 23 on Linux 64bit
plaform.python_version: 3.12.11
platform.platform: Linux
oracledb.__version__: 3.4.2
2. Is it an error or a hang or a crash?
Error
3. What error(s) or behavior you are seeing?
When calling init_oracle_client to initialize thick mode with the defined lib_dir variable point to the folder, the following error is obtained.
DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library "libnnz.so: cannot open shared object file: No such file or directory"
The error can be removed by setting the LD_LIBRARY_PATH to point to the instant client before starting the python process (the variable cannot be set using os.environ inside the python process). However, this workaround:
- Is a differnet behaviour than the Windows version of
init_oracle_client where only the lib_dir need to be defined.
- Is not ideal as another script need to be run before the python process to set the LD_LIBRARY_PATH for the users.
4. Does your application call init_oracle_client()?
I am using thick mode
5. Include a runnable Python script that shows the problem.
import oracledb
oracledb.init_oracle_client(lib_dir="path/to/instant_client")
Final notes
This is probably can be classified as the wrong expected behaviour rather than a bug in the technical term. I understand that there are workarounds to set the LD_LIBRARY_PATH automatically for users and using the installers for the instant client. However, this removes some of the portability of hte the instant client (i.e., zip version).
Anyway, I thought to document it here and see if anybody has a best practice for this issue.
1. What versions are you using?
2. Is it an error or a hang or a crash?
Error
3. What error(s) or behavior you are seeing?
When calling
init_oracle_clientto initialize thick mode with the definedlib_dirvariable point to the folder, the following error is obtained.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library "libnnz.so: cannot open shared object file: No such file or directory"The error can be removed by setting the
LD_LIBRARY_PATHto point to the instant client before starting the python process (the variable cannot be set using os.environ inside the python process). However, this workaround:init_oracle_clientwhere only thelib_dirneed to be defined.4. Does your application call init_oracle_client()?
I am using thick mode
5. Include a runnable Python script that shows the problem.
Final notes
This is probably can be classified as the wrong expected behaviour rather than a bug in the technical term. I understand that there are workarounds to set the LD_LIBRARY_PATH automatically for users and using the installers for the instant client. However, this removes some of the portability of hte the instant client (i.e., zip version).
Anyway, I thought to document it here and see if anybody has a best practice for this issue.