error when connecting oracle in python using cx_Oracle

前端 未结 4 1773
耶瑟儿~
耶瑟儿~ 2021-01-19 16:29

I was trying to connect oracle database using python like below.

import cx_Oracle
conn = cx_Oracle.connect(\'user/password@host:port/database\')
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-19 17:17

    This error come when your Oracle Client is not installed or LD_LIBRARY_PATH is not set where libclntsh.so is present.

    if you have Oracle client installed then search for libclntsh.so and set the LD_LIBRARY_PATH as

    "export LD_LIBRARY_PATH=/app/bds/parcels/ORACLE_INSTANT_CLIENT/instantclient_11_2:$LD_LIBRARY_PATH"

提交回复
热议问题