0

I tried connecting to oracle using cx_oracle in python but getting an error.

Tried this:

  1. I even formatted my machine and updated java version.

  2. Amazon Python 2.7 Lambda: DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so" but still did not work.

Versions Used : python 3.7, Anaconda 3.7

import cx_Oracle

connect_string = 'Username/password@hostname:port/sid'
connection = cx_Oracle.connect(connect_string)
cursor = connection.cursor()
cursor.execute("Select * from table_name")
for rows in cursor:
    print(rows)

Error : cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "dlopen(libclntsh.dylib, 1): image not found". See https://oracle.github.io/odpi/doc/installation.html#macos for help

  • [Duplicate question](https://stackoverflow.com/questions/46098562/cx-oracle-databaseerror-dpi-1047-64-bit-oracle-client-library-cannot-be-loaded). Did you follow the instructions in the error message link? Which Oracle client did you download (step 1), where did you put it (step 2), and where did you put the links (step 3)? – kfinity Sep 05 '19 at 12:52
  • Also see https://stackoverflow.com/questions/55053472/accessing-oracle-from-aws-lambda-in-python – Christopher Jones Sep 06 '19 at 05:03

0 Answers0