How to fix: cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library - Python

后端 未结 4 1797
失恋的感觉
失恋的感觉 2021-01-01 18:45

I am establishing a connection to oracle 11g which is in a remote server using cx_oracle 7 with python 3.6.7. my OS in Ubuntu 18.04

I have installed oracle instant c

4条回答
  •  我在风中等你
    2021-01-01 19:03

    After some more research i got the solution from ubunu community , after you have installed oracle instantclient you will have to integrate oracle libraries as follows:

    export LD_LIBRARY_PATH=/usr/lib/oracle//client(64)/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

    For example, 12.1 version for Linux x86_64:

    export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

    where indicates the version of your of your oracle intantclient e.g 11.2, 12.2
    The connection parameter should be as follows connection = cx_Oracle.connect("username/password@host/service_name e.g orcl")

    to get the listener/service_name type the following in the oracle sqlplus

    SQL> show parameter local_listener
    

    the value is the listener

提交回复
热议问题