Get data from oracle DB via python

Hi

I try to connect into my oracle db with python using cx_Oracle module, but I’m receiving an error that the module can’t find the path.

DatabaseError

DPI-1047: Cannot locate a 64-bit Oracle Client library: “libclntsh.so: cannot open shared object file: No such file or directory”. See cx_Oracle 8 Installation — cx_Oracle 8.3.0 documentation for help

DETAILS

Traceback (most recent call last):

  File "/nano-py/pipedream/worker.py", line 113, in execute
    user_retval = handler(pd)

  File "/tmp/__pdg__/dist/code/471b4b0ec16e0541e0ae5e75bb95f5001d078e29e81d956e33fae8bc88945c10/code.py", line 84, in handler
    histcusto()

  File "/tmp/__pdg__/dist/code/471b4b0ec16e0541e0ae5e75bb95f5001d078e29e81d956e33fae8bc88945c10/code.py", line 25, in histcusto
    conn = cx_Oracle.connect(user=XXXXXXX, password=XXXXXXXX, dsn=dsn_tns) 

cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.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

There is a workaround?

Hi @gabrielluiz

That particular Python package is expecting an Oracle Client Library to be installed before the Python script is ran.

I recommend reading the instructions on that Python package from Oracle to see if there are additional installation steps to run before importing the Python module.

You can use Bash steps to download and step up files in the /tmp directory. You may need to download this Oracle Client library, then reference it’s location to the Python module.

1 Like