Skip to content

Instant Client Initilization in Thick Mode and Setting LD_LIBRARY_PATH #578

@MosGeo

Description

@MosGeo

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:

  1. Is a differnet behaviour than the Windows version of init_oracle_client where only the lib_dir need to be defined.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions